CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of BOOST_AUTO_FUNCTION
C++
/*==============================================================================
    Copyright (c) 2010 Matthew Calabrese

    Use, modification and distribution is subject to the Boost Software
    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
 
// Note: Currently only tested on GCC 4.5.1
by Matt Calabrese   October 16, 2010 @ 11:13pm
291 Views
no comments
 
C++
// Note: The compiler does not need "requires" or concepts for this to work
//       Also notice that here the predicate is a type
template< class L, class R >
BOOST_AUTO_FUNCTION( add( L left, R right ) )
  ( requires boost::is_pointer< L > )
(
  return left + right // no semicolon, must be an expression
) // Note these are parentheses
 
// Same as above only the predicate is a value
by Matt Calabrese   October 15, 2010 @ 3:48pm
306 Views
no comments
 
C++
#include <new>
#include <utility>
 
// This macro is variadic in order to directly support operator,
#define BOOST_AUTO_FUNCTION( ... ) auto __VA_ARGS__ -> BOOST_AUTO_FUNCTION_IMPL
 
#define BOOST_AUTO_VOID_FUNCTION( ... )                                        \
auto __VA_ARGS__ -> BOOST_AUTO_VOID_FUNCTION_IMPL
 
// Variadic to support expressions with commas not between parentheses
by Matt Calabrese   October 13, 2010 @ 4:22pm
291 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate