Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52783 - sandbox/boost0x/boost/function
From: gordon_at_[hidden]
Date: 2009-05-05 19:14:03


Author: gordon.woodhull
Date: 2009-05-05 19:14:02 EDT (Tue, 05 May 2009)
New Revision: 52783
URL: http://svn.boost.org/trac/boost/changeset/52783

Log:
bad chars?
Text files modified:
   sandbox/boost0x/boost/function/function_variadic_invoker.hpp | 520 ++++++++++++++++++++--------------------
   1 files changed, 260 insertions(+), 260 deletions(-)

Modified: sandbox/boost0x/boost/function/function_variadic_invoker.hpp
==============================================================================
--- sandbox/boost0x/boost/function/function_variadic_invoker.hpp (original)
+++ sandbox/boost0x/boost/function/function_variadic_invoker.hpp 2009-05-05 19:14:02 EDT (Tue, 05 May 2009)
@@ -2,239 +2,239 @@
   namespace detail {
     namespace function {
       template<
- typename FunctionPtr,
- typename R,
- typename ... Args
- >
+ typename FunctionPtr,
+ typename R,
+ typename ... Args
+ >
       struct function_invoker
       {
- static R invoke(function_buffer& function_ptr, Args... args)
- {
- FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
- return f(args...);
- }
+ static R invoke(function_buffer& function_ptr, Args... args)
+ {
+ FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
+ return f(args...);
+ }
       };
 
       template<
- typename FunctionPtr,
- typename R,
-
 typename ... Args
- >
+ typename FunctionPtr,
+ typename R,
+
 typename ... Args
+ >
       struct void_function_invoker
       {
- static BOOST_FUNCTION_VOID_RETURN_TYPE
- invoke(function_buffer& function_ptr, Args... args)
+ static BOOST_FUNCTION_VOID_RETURN_TYPE
+ invoke(function_buffer& function_ptr, Args... args)
 
- {
- FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
- BOOST_FUNCTION_RETURN(f(args...));
- }
+ {
+ FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
+ BOOST_FUNCTION_RETURN(f(args...));
+ }
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
>
       struct function_obj_invoker
       {
- static R invoke(function_buffer& function_obj_ptr, Args... args)
+ static R invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- FunctionObj* f;
- if (function_allows_small_object_optimization<FunctionObj>::value)
- f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
- else
- f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
- return (*f)(args...);
- }
+ {
+ FunctionObj* f;
+ if (function_allows_small_object_optimization<FunctionObj>::value)
+ f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
+ else
+ f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
+ return (*f)(args...);
+ }
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
>
       struct void_function_obj_invoker
       {
- static BOOST_FUNCTION_VOID_RETURN_TYPE
- invoke(function_buffer& function_obj_ptr, Args... args)
+ static BOOST_FUNCTION_VOID_RETURN_TYPE
+ invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- FunctionObj* f;
- if (function_allows_small_object_optimization<FunctionObj>::value)
- f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
- else
- f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
- BOOST_FUNCTION_RETURN((*f)(args...));
- }
+ {
+ FunctionObj* f;
+ if (function_allows_small_object_optimization<FunctionObj>::value)
+ f = reinterpret_cast<FunctionObj*>(&function_obj_ptr.data);
+ else
+ f = reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
+ BOOST_FUNCTION_RETURN((*f)(args...));
+ }
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
>
       struct function_ref_invoker
       {
- static R invoke(function_buffer& function_obj_ptr, Args... args)
+ static R invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- FunctionObj* f =
- reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
- return (*f)(args...);
- }
+ {
+ FunctionObj* f =
+ reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
+ return (*f)(args...);
+ }
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
>
       struct void_function_ref_invoker
       {
- static BOOST_FUNCTION_VOID_RETURN_TYPE
- invoke(function_buffer& function_obj_ptr, Args... args)
+ static BOOST_FUNCTION_VOID_RETURN_TYPE
+ invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- FunctionObj* f =
- reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
- BOOST_FUNCTION_RETURN((*f)(args...));
- }
+ {
+ FunctionObj* f =
+ reinterpret_cast<FunctionObj*>(function_obj_ptr.obj_ptr);
+ BOOST_FUNCTION_RETURN((*f)(args...));
+ }
       };
 
 #if BOOST_FUNCTION_NUM_ARGS > 0
       /* Handle invocation of member pointers. */
       template<
- typename MemberPtr,
- typename R,
-
 typename ... Args
+ typename MemberPtr,
+ typename R,
+
 typename ... Args
>
       struct function_mem_invoker
       {
- static R invoke(function_buffer& function_obj_ptr, Args... args)
+ static R invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- MemberPtr* f =
- reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
- return boost::mem_fn(*f)(args...);
- }
+ {
+ MemberPtr* f =
+ reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
+ return boost::mem_fn(*f)(args...);
+ }
       };
 
       template<
- typename MemberPtr,
- typename R,
-
 typename ... Args
+ typename MemberPtr,
+ typename R,
+
 typename ... Args
>
       struct function_void_mem_invoker
       {
- static BOOST_FUNCTION_VOID_RETURN_TYPE
- invoke(function_buffer& function_obj_ptr, Args... args)
+ static BOOST_FUNCTION_VOID_RETURN_TYPE
+ invoke(function_buffer& function_obj_ptr, Args... args)
 
- {
- MemberPtr* f =
- reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
- BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(args...));
- }
+ {
+ MemberPtr* f =
+ reinterpret_cast<MemberPtr*>(&function_obj_ptr.data);
+ BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(args...));
+ }
       };
 #endif
 
       template<
- typename FunctionPtr,
- typename R,
-
 typename ... Args
+ typename FunctionPtr,
+ typename R,
+
 typename ... Args
>
       struct get_function_invoker
       {
- typedef typename mpl::if_c<(is_void<R>::value),
- void_function_invoker<
- FunctionPtr,
- R,
-
 Args...
- >,
- function_invoker<
- FunctionPtr,
- R,
-
 Args...
- >
- >::type type;
+ typedef typename mpl::if_c<(is_void<R>::value),
+ void_function_invoker<
+ FunctionPtr,
+ R,
+
 Args...
+ >,
+ function_invoker<
+ FunctionPtr,
+ R,
+
 Args...
+ >
+ >::type type;
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
- >
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
+ >
       struct get_function_obj_invoker
       {
- typedef typename mpl::if_c<(is_void<R>::value),
- void_function_obj_invoker<
- FunctionObj,
- R,
-
 Args...
- >,
- function_obj_invoker<
- FunctionObj,
- R,
-
 Args...
- >
- >::type type;
+ typedef typename mpl::if_c<(is_void<R>::value),
+ void_function_obj_invoker<
+ FunctionObj,
+ R,
+
 Args...
+ >,
+ function_obj_invoker<
+ FunctionObj,
+ R,
+
 Args...
+ >
+ >::type type;
       };
 
       template<
- typename FunctionObj,
- typename R,
-
 typename ... Args
- >
+ typename FunctionObj,
+ typename R,
+
 typename ... Args
+ >
       struct get_function_ref_invoker
       {
- typedef typename mpl::if_c<(is_void<R>::value),
- BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER<
- FunctionObj,
- R,
-
 Args...
- >,
- function_ref_invoker<
- FunctionObj,
- R,
-
 Args...
- >
- >::type type;
+ typedef typename mpl::if_c<(is_void<R>::value),
+ BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER<
+ FunctionObj,
+ R,
+
 Args...
+ >,
+ function_ref_invoker<
+ FunctionObj,
+ R,
+
 Args...
+ >
+ >::type type;
       };
 
 #if BOOST_FUNCTION_NUM_ARGS > 0
       /* Retrieve the appropriate invoker for a member pointer. */
       template<
- typename MemberPtr,
- typename R,
-
 typename ... Args
- >
+ typename MemberPtr,
+ typename R,
+
 typename ... Args
+ >
       struct get_member_invoker
       {
- typedef typename mpl::if_c<(is_void<R>::value),
- function_void_mem_invoker<
- MemberPtr,
- R,
-
 Args...
- >,
- function_mem_invoker<
- MemberPtr,
- R,
-
 Args...
- >
- >::type type;
+ typedef typename mpl::if_c<(is_void<R>::value),
+ function_void_mem_invoker<
+ MemberPtr,
+ R,
+
 Args...
+ >,
+ function_mem_invoker<
+ MemberPtr,
+ R,
+
 Args...
+ >
+ >::type type;
       };
 #endif
 
       /* Given the tag returned by get_function_tag, retrieve the
- actual invoker that will be used for the given function
- object.
+ actual invoker that will be used for the given function
+ object.
 
- Each specialization contains an "apply" nested class template
- that accepts the function object, return type, function
- argument types, and allocator. The resulting "apply" class
- contains two typedefs, "invoker_type" and "manager_type",
- which correspond to the invoker and manager types. */
+ Each specialization contains an "apply" nested class template
+ that accepts the function object, return type, function
+ argument types, and allocator. The resulting "apply" class
+ contains two typedefs, "invoker_type" and "manager_type",
+ which correspond to the invoker and manager types. */
       template<typename Tag>
       struct get_invoker { };
 
@@ -242,34 +242,34 @@
       template<>
       struct get_invoker<function_ptr_tag>
       {
- template<typename FunctionPtr,
- typename R, typename ... Args>
- struct apply
- {
- typedef typename get_function_invoker<
- FunctionPtr,
- R,
-
 Args...
- >::type
- invoker_type;
-
- typedef functor_manager<FunctionPtr> manager_type;
- };
-
- template<typename FunctionPtr,
- typename Allocator,
- typename R, typename ... Args>
- struct apply_a
- {
- typedef typename get_function_invoker<
- FunctionPtr,
- R,
-
 Args...
- >::type
- invoker_type;
+ template<typename FunctionPtr,
+ typename R, typename ... Args>
+ struct apply
+ {
+ typedef typename get_function_invoker<
+ FunctionPtr,
+ R,
+
 Args...
+ >::type
+ invoker_type;
+
+ typedef functor_manager<FunctionPtr> manager_type;
+ };
+
+ template<typename FunctionPtr,
+ typename Allocator,
+ typename R, typename ... Args>
+ struct apply_a
+ {
+ typedef typename get_function_invoker<
+ FunctionPtr,
+ R,
+
 Args...
+ >::type
+ invoker_type;
 
- typedef functor_manager<FunctionPtr> manager_type;
- };
+ typedef functor_manager<FunctionPtr> manager_type;
+ };
       };
 
 #if BOOST_FUNCTION_NUM_ARGS > 0
@@ -277,34 +277,34 @@
       template<>
       struct get_invoker<member_ptr_tag>
       {
- template<typename MemberPtr,
- typename R, typename ... Args>
- struct apply
- {
- typedef typename get_member_invoker<
- MemberPtr,
- R,
-
 Args...
- >::type
- invoker_type;
-
- typedef functor_manager<MemberPtr> manager_type;
- };
-
- template<typename MemberPtr,
- typename Allocator,
- typename R, typename ... Args>
- struct apply_a
- {
- typedef typename get_member_invoker<
- MemberPtr,
- R,
-
 Args...
- >::type
- invoker_type;
+ template<typename MemberPtr,
+ typename R, typename ... Args>
+ struct apply
+ {
+ typedef typename get_member_invoker<
+ MemberPtr,
+ R,
+
 Args...
+ >::type
+ invoker_type;
+
+ typedef functor_manager<MemberPtr> manager_type;
+ };
+
+ template<typename MemberPtr,
+ typename Allocator,
+ typename R, typename ... Args>
+ struct apply_a
+ {
+ typedef typename get_member_invoker<
+ MemberPtr,
+ R,
+
 Args...
+ >::type
+ invoker_type;
 
- typedef functor_manager<MemberPtr> manager_type;
- };
+ typedef functor_manager<MemberPtr> manager_type;
+ };
       };
 #endif
 
@@ -312,68 +312,68 @@
       template<>
       struct get_invoker<function_obj_tag>
       {
- template<typename FunctionObj,
- typename R, typename ... Args>
- struct apply
- {
- typedef typename get_function_obj_invoker<
- FunctionObj,
- R,
-
 Args...
- >::type
- invoker_type;
-
- typedef functor_manager<FunctionObj> manager_type;
- };
-
- template<typename FunctionObj,
- typename Allocator,
- typename R, typename ... Args>
- struct apply_a
- {
- typedef typename get_function_obj_invoker<
- FunctionObj,
- R,
-
 Args...
- >::type
- invoker_type;
+ template<typename FunctionObj,
+ typename R, typename ... Args>
+ struct apply
+ {
+ typedef typename get_function_obj_invoker<
+ FunctionObj,
+ R,
+
 Args...
+ >::type
+ invoker_type;
+
+ typedef functor_manager<FunctionObj> manager_type;
+ };
+
+ template<typename FunctionObj,
+ typename Allocator,
+ typename R, typename ... Args>
+ struct apply_a
+ {
+ typedef typename get_function_obj_invoker<
+ FunctionObj,
+ R,
+
 Args...
+ >::type
+ invoker_type;
 
- typedef functor_manager_a<FunctionObj, Allocator> manager_type;
- };
+ typedef functor_manager_a<FunctionObj, Allocator> manager_type;
+ };
       };
 
       /* Retrieve the invoker for a reference to a function object. */
       template<>
       struct get_invoker<function_obj_ref_tag>
       {
- template<typename RefWrapper,
- typename R, typename ... Args>
- struct apply
- {
- typedef typename get_function_ref_invoker<
- typename RefWrapper::type,
- R,
-
 Args...
- >::type
- invoker_type;
-
- typedef reference_manager<typename RefWrapper::type> manager_type;
- };
-
- template<typename RefWrapper,
- typename Allocator,
- typename R, typename ... Args>
- struct apply_a
- {
- typedef typename get_function_ref_invoker<
- typename RefWrapper::type,
- R,
-
 Args...
- >::type
- invoker_type;
+ template<typename RefWrapper,
+ typename R, typename ... Args>
+ struct apply
+ {
+ typedef typename get_function_ref_invoker<
+ typename RefWrapper::type,
+ R,
+
 Args...
+ >::type
+ invoker_type;
+
+ typedef reference_manager<typename RefWrapper::type> manager_type;
+ };
+
+ template<typename RefWrapper,
+ typename Allocator,
+ typename R, typename ... Args>
+ struct apply_a
+ {
+ typedef typename get_function_ref_invoker<
+ typename RefWrapper::type,
+ R,
+
 Args...
+ >::type
+ invoker_type;
 
- typedef reference_manager<typename RefWrapper::type> manager_type;
- };
+ typedef reference_manager<typename RefWrapper::type> manager_type;
+ };
       };
     } // end namespace function
   } // end namespace detail


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk