// // Copyright (c) 2009 Rutger ter Borg // // Distributed under 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) // #ifndef BOOST_NUMERIC_BINDINGS_DETAIL_GENERATE_FUNCTIONS_HPP #define BOOST_NUMERIC_BINDINGS_DETAIL_GENERATE_FUNCTIONS_HPP #include #include // // Macro used to generate convenience functions // #define GENERATE_FUNCTIONS( function_name, suffix, tag ) \ \ namespace result_of {\ \ template< typename T > \ struct BOOST_PP_CAT( function_name, suffix ) { \ typedef typename detail::\ BOOST_PP_CAT( function_name, _impl ) \ ::result_type type; \ }; \ \ }\ \ template< typename T >\ typename result_of:: BOOST_PP_CAT( function_name, suffix )::type \ BOOST_PP_CAT( function_name, suffix )( T& t ) {\ return detail:: \ BOOST_PP_CAT( function_name, _impl ) \ ::invoke( t );\ }\ \ template< typename T >\ typename result_of:: BOOST_PP_CAT( function_name, suffix )::type \ BOOST_PP_CAT( function_name, suffix )( const T& t ) {\ return detail:: \ BOOST_PP_CAT( function_name, _impl ) \ ::invoke( t );\ } #endif