Changeset 63943
 Timestamp:
 Jul 13, 2010, 8:24:53 AM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sandbox/variadic_templates/boost/composite_storage/pack/multiple_dispatch/apply_unpack.hpp
r63404 r63943 12 12 #include <boost/mpl/package_range_c.hpp> 13 13 #include <boost/type_traits/remove_cv.hpp> 14 #include <boost/function_types/can_be_called.hpp>15 14 #include <exception> 15 #ifndef APPLY_UNPACK_USER_CHECKED_ARGS 16 #include <boost/function_types/can_be_called.hpp> 17 #endif 16 18 17 19 namespace boost … … 30 32 }; 31 33 32 template <typename Functor, typename... Args>33 typename functor_result_type<Functor>::type34 apply_ftor_callable_args( mpl::bool_<true>, Functor& ftor35 , Args const&... args)36 {37 return ftor(args...);38 };39 40 34 template<typename FunctorArgs> 41 35 struct bad_functor_args … … 50 44 }; 51 45 46 #ifdef APPLY_UNPACK_USER_CHECKED_ARGS 47 template 48 < typename Functor 49 , typename ResultType 50 > 51 struct functor_bad_args 52 { 53 typedef ResultType result_type; 54 55 template<typename... Args> 56 result_type operator()(Args&... args)FUNCTOR_CONSTANCY throw() 57 { 58 throw bad_functor_args<Functor(Args&...)>(); 59 return result_type(); 60 } 61 }; 62 63 #else 64 template <typename Functor, typename... Args> 65 typename functor_result_type<Functor>::type 66 apply_ftor_callable_args( mpl::bool_<true>, Functor& ftor 67 , Args const&... args) 68 { 69 return ftor(args...); 70 }; 71 52 72 template <typename Functor, typename... Args> 53 73 typename functor_result_type<Functor>::type … … 78 98 , ftor, args...); 79 99 }; 100 #endif 80 101 81 102 template <typename Indices> … … 90 111 { 91 112 return 92 #ifndef APPLY_UNPACK_ DEMO_UNCHECK_ARGS113 #ifndef APPLY_UNPACK_USER_CHECKED_ARGS 93 114 apply_ftor_check_args( a_functor 94 115 , a_args.template project<Indices>()...);
Note: See TracChangeset
for help on using the changeset viewer.