[Orxonox-commit 6323] r10980 - code/branches/cpp11_v2/src/libraries/core/command

landauf at orxonox.net landauf at orxonox.net
Sun Dec 27 20:36:22 CET 2015


Author: landauf
Date: 2015-12-27 20:36:21 +0100 (Sun, 27 Dec 2015)
New Revision: 10980

Modified:
   code/branches/cpp11_v2/src/libraries/core/command/Functor.h
Log:
getHeaderIdentifier(): return the typeid of the actual function pointer instead of FunctorHeaderIdentifier

Modified: code/branches/cpp11_v2/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-25 23:05:20 UTC (rev 10979)
+++ code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-27 19:36:21 UTC (rev 10980)
@@ -406,11 +406,6 @@
         template <class R, bool isconst, class... Params>                  struct FunctorCaller<R, void, isconst, Params...>           { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, Params...>::Type functionPointer, void*, const Params&... parameters)     { return (*functionPointer)(parameters...); } };
         template <bool isconst, class... Params>                           struct FunctorCaller<void, void, isconst, Params...>        { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, Params...>::Type functionPointer, void*, const Params&... parameters)  { (*functionPointer)(parameters...); return MultiType::Null; } };
 
-        // Helper class, used to identify the header of a function-pointer (independent of its class)
-        template <class R, class... Params>
-        struct FunctorHeaderIdentifier
-        {};
-
         // Helper class to determine if a function has a returnvalue
         template <class T>
         struct FunctorHasReturnvalue
@@ -528,7 +523,7 @@
             // see Functor::getHeaderIdentifier()
             virtual const std::type_index getHeaderIdentifier() const override
             {
-                return typeid(detail::FunctorHeaderIdentifier<R, Params...>);
+                return typeid(typename detail::FunctionPointer<R, void, false, Params...>::Type);
             }
 
             // see Functor::getHeaderIdentifier(unsigned int)
@@ -563,7 +558,7 @@
             template<class... Types>
             const std::type_index getTypelistIdentifier(detail::type_list<Types...>) const
             {
-                return typeid(detail::FunctorHeaderIdentifier<R, Types...>);
+                return typeid(typename detail::FunctionPointer<R, void, false, Types...>::Type);
             }
     };
 




More information about the Orxonox-commit mailing list