diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /boost/function/function_template.hpp | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'boost/function/function_template.hpp')
-rw-r--r-- | boost/function/function_template.hpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/boost/function/function_template.hpp b/boost/function/function_template.hpp index 72b7fabd1..ab7abc514 100644 --- a/boost/function/function_template.hpp +++ b/boost/function/function_template.hpp @@ -26,7 +26,13 @@ #define BOOST_FUNCTION_PARMS BOOST_PP_ENUM(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_PARM,BOOST_PP_EMPTY) -#define BOOST_FUNCTION_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, a) +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES +# define BOOST_FUNCTION_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, a) +#else +# include <boost/move/utility_core.hpp> +# define BOOST_FUNCTION_ARG(J,I,D) ::boost::forward< BOOST_PP_CAT(T,I) >(BOOST_PP_CAT(a,I)) +# define BOOST_FUNCTION_ARGS BOOST_PP_ENUM(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_ARG,BOOST_PP_EMPTY) +#endif #define BOOST_FUNCTION_ARG_TYPE(J,I,D) \ typedef BOOST_PP_CAT(T,I) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(I)),_type); @@ -914,10 +920,10 @@ namespace boost { template<typename Functor> void assign_to(Functor f) { - using detail::function::vtable_base; + using boost::detail::function::vtable_base; - typedef typename detail::function::get_function_tag<Functor>::type tag; - typedef detail::function::BOOST_FUNCTION_GET_INVOKER<tag> get_invoker; + typedef typename boost::detail::function::get_function_tag<Functor>::type tag; + typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER<tag> get_invoker; typedef typename get_invoker:: template apply<Functor, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> @@ -938,9 +944,9 @@ namespace boost { // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor<Functor>::value && boost::has_trivial_destructor<Functor>::value && - detail::function::function_allows_small_object_optimization<Functor>::value) + boost::detail::function::function_allows_small_object_optimization<Functor>::value) value |= static_cast<std::size_t>(0x01); - vtable = reinterpret_cast<detail::function::vtable_base *>(value); + vtable = reinterpret_cast<boost::detail::function::vtable_base *>(value); } else vtable = 0; } @@ -948,10 +954,10 @@ namespace boost { template<typename Functor,typename Allocator> void assign_to_a(Functor f,Allocator a) { - using detail::function::vtable_base; + using boost::detail::function::vtable_base; - typedef typename detail::function::get_function_tag<Functor>::type tag; - typedef detail::function::BOOST_FUNCTION_GET_INVOKER<tag> get_invoker; + typedef typename boost::detail::function::get_function_tag<Functor>::type tag; + typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER<tag> get_invoker; typedef typename get_invoker:: template apply_a<Functor, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS, @@ -973,9 +979,9 @@ namespace boost { // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor<Functor>::value && boost::has_trivial_destructor<Functor>::value && - detail::function::function_allows_small_object_optimization<Functor>::value) + boost::detail::function::function_allows_small_object_optimization<Functor>::value) value |= static_cast<std::size_t>(0x01); - vtable = reinterpret_cast<detail::function::vtable_base *>(value); + vtable = reinterpret_cast<boost::detail::function::vtable_base *>(value); } else vtable = 0; } @@ -1176,6 +1182,9 @@ public: #undef BOOST_FUNCTION_TEMPLATE_ARGS #undef BOOST_FUNCTION_PARMS #undef BOOST_FUNCTION_PARM +#ifdef BOOST_FUNCTION_ARG +# undef BOOST_FUNCTION_ARG +#endif #undef BOOST_FUNCTION_ARGS #undef BOOST_FUNCTION_ARG_TYPE #undef BOOST_FUNCTION_ARG_TYPES |