Index: code/trunk/src/libraries/core/command/Functor.h
===================================================================
--- code/trunk/src/libraries/core/command/Functor.h	(revision 9667)
+++ code/trunk/src/libraries/core/command/Functor.h	(revision 11071)
@@ -40,7 +40,7 @@
 
     To create a Functor, the helper function createFunctor() is used. It returns an instance
-    of orxonox::FunctorPtr which is simply a typedef of @ref orxonox::SharedPtr "SharedPtr<Functor>".
-    This means you don't have to delete the Functor after using it, because it is managed
-    by the SharedPtr.
+    of orxonox::FunctorPtr which is simply a typedef of "std::shared_ptr<Functor>". This
+    means you don't have to delete the Functor after using it, because it is managed
+    by the std::shared_ptr.
 
     Example:
@@ -176,16 +176,13 @@
     {
         public:
-            struct Type
-            {
-                /// Defines the type of a function (static or member)
-                enum Enum
-                {
-                    Static,
-                    Member
-                };
+            /// Defines the type of a function (static or member)
+            enum class Type
+            {
+                Static,
+                Member
             };
 
         public:
-            virtual ~Functor() {}
+            virtual ~Functor() = default;
 
             /// Calls the function-pointer with up to five arguments. In case of a member-function, the assigned object-pointer is used to call the function. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
@@ -196,5 +193,5 @@
 
             /// Returns the type of the function: static or member.
-            virtual Type::Enum getType() const = 0;
+            virtual Type getType() const = 0;
             /// Returns the number of parameters of the function.
             virtual unsigned int getParamCount() const = 0;
@@ -215,5 +212,5 @@
             virtual void* getRawObjectPointer() const = 0;
 
-            /// Enables or disables the safe mode which causes the functor to change the object pointer to NULL if the object is deleted (only member functors).
+            /// Enables or disables the safe mode which causes the functor to change the object pointer to nullptr if the object is deleted (only member functors).
             virtual void setSafeMode(bool bSafeMode) = 0;
 
@@ -242,12 +239,12 @@
         public:
             /// Constructor: Stores the object-pointer.
-            FunctorMember(O* object = 0) : object_(object), bSafeMode_(false) {}
+            FunctorMember(O* object = nullptr) : object_(object), bSafeMode_(false) {}
             virtual ~FunctorMember() { if (this->bSafeMode_) { this->unregisterObject(this->object_); } }
 
-            /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
+            /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
             virtual MultiType operator()(O* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) = 0;
 
             // see Functor::operator()()
-            MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null)
+            virtual MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) override
             {
                 // call the function if an object was assigned
@@ -262,5 +259,5 @@
 
             // see Functor::getType()
-            inline Functor::Type::Enum getType() const
+            virtual inline Functor::Type getType() const override
                 { return Functor::Type::Member; }
 
@@ -280,12 +277,12 @@
 
             // see Functor::setRawObjectPointer()
-            inline void setRawObjectPointer(void* object)
+            virtual inline void setRawObjectPointer(void* object) override
                 { this->setObject((O*)object); }
             // see Functor::getRawObjectPointer()
-            inline void* getRawObjectPointer() const
+            virtual inline void* getRawObjectPointer() const override
                 { return this->object_; }
 
             // see Functor::setSafeMode()
-            inline void setSafeMode(bool bSafeMode)
+            virtual inline void setSafeMode(bool bSafeMode) override
             {
                 if (bSafeMode == this->bSafeMode_)
@@ -301,17 +298,22 @@
 
         protected:
-            /// Casts the object and registers as destruction listener.
-            inline void registerObject(O* object)
-                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->registerAsDestructionListener(base); } }
-            /// Casts the object and unregisters as destruction listener.
-            inline void unregisterObject(O* object)
-                { Destroyable* base = dynamic_cast<Destroyable*>(object); if (base) { this->unregisterAsDestructionListener(base); } }
-
-            /// Will be called by Destroyable::~Destroyable() if the stored object is deleted and the Functor is in safe mode.
-            inline void objectDeleted()
-                { this->object_ = 0; }
-
-            O* object_;     ///< The stored object-pointer, used to execute a member-function (or NULL for static functions)
-            bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to NULL if the object is deleted
+            /// Casts the object and registers as destruction listener if the object is a Destroyable.
+            inline void registerObject(Destroyable* object)
+                { this->registerAsDestructionListener(object); }
+
+            inline void registerObject(void* object) {}
+
+            /// Casts the object and unregisters as destruction listener if the object is a Destroyable.
+            inline void unregisterObject(Destroyable* object)
+                { this->unregisterAsDestructionListener(object); }
+
+            inline void unregisterObject(void* object) {}
+
+            /// Will be called by Destroyable::~Destroyable() if the stored object is a Destroyable and deleted and the Functor is in safe mode.
+            virtual inline void objectDeleted() override
+                { this->object_ = nullptr; }
+
+            O* object_;     ///< The stored object-pointer, used to execute a member-function (or nullptr for static functions)
+            bool bSafeMode_; ///< If true, the functor is in safe mode and registers itself as listener at the object and changes the pointer to nullptr if the object is deleted
     };
 
@@ -322,28 +324,28 @@
         public:
             /// Constructor: Stores the object-pointer.
-            FunctorMember(void* object = 0) {}
-
-            /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be NULL. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
+            FunctorMember(void* object = nullptr) {}
+
+            /// Calls the function-pointer with up to five arguments and an object. In case of a static-function, the object can be nullptr. @return Returns the return-value of the function (if any; MultiType::Null otherwise)
             virtual MultiType operator()(void* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) = 0;
 
             // see Functor::operator()()
-            MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null)
-            {
-                return (*this)((void*)0, param1, param2, param3, param4, param5);
+            virtual MultiType operator()(const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) override
+            {
+                return (*this)((void*)nullptr, param1, param2, param3, param4, param5);
             }
 
             // see Functor::getType()
-            inline Functor::Type::Enum getType() const
+            virtual inline Functor::Type getType() const override
                 { return Functor::Type::Static; }
 
             // see Functor::setRawObjectPointer()
-            inline void setRawObjectPointer(void*)
+            virtual inline void setRawObjectPointer(void*) override
                 { orxout(internal_warning) << "Can't assign an object pointer to a static functor" << endl; }
             // see Functor::getRawObjectPointer()
-            inline void* getRawObjectPointer() const
-                { return 0; }
+            virtual inline void* getRawObjectPointer() const override
+                { return nullptr; }
 
             // see Functor::setSafeMode()
-            inline void setSafeMode(bool) {}
+            virtual inline void setSafeMode(bool) override {}
     };
 
@@ -352,12 +354,12 @@
 
     /**
-        @brief FunctorPointer is a child class of FunctorMember and expands it with a function-pointer.
-        @param F The type of the function-pointer
-        @param O The type of the function's class (or void if it's a static function)
+        @brief FunctorPointer is a child class of FunctorMember and extends it with a function-pointer (or a function-object).
+        @param F The type of the function-pointer (or the function-object)
+        @param O The type of the function's class (or void if it's a static function or a function-object)
 
         The template FunctorPointer has an additional template parameter that defines the type
-        of the function-pointer. This can be handy if you want to get or set the function-pointer.
-        You can then use a static_cast to cast a Functor to FunctorPointer if you know the type
-        of the function-pointer.
+        of the function-pointer (or the function-object). This can be handy if you want to get
+        or set the function-pointer (or the function-object). You can then use a static_cast
+        to cast a Functor to FunctorPointer if you know the type of the function.
 
         However FunctorPointer is not aware of the types of the different parameters or the
@@ -369,5 +371,5 @@
         public:
             /// Constructor: Initializes the base class and stores the function-pointer.
-            FunctorPointer(F functionPointer, O* object = 0) : FunctorMember<O>(object), functionPointer_(functionPointer) {}
+            FunctorPointer(F functionPointer, O* object = nullptr) : FunctorMember<O>(object), functionPointer_(functionPointer) {}
 
             /// Changes the function-pointer.
@@ -378,8 +380,4 @@
                 { return this->functionPointer_; }
 
-            // see Functor::getFullIdentifier()
-            const std::type_info& getFullIdentifier() const
-                { return typeid(F); }
-
         protected:
             F functionPointer_;     ///< The stored function-pointer
@@ -388,55 +386,19 @@
     namespace detail
     {
-        // Helper class to get the type of the function pointer with the given class, parameters, return-value, and constness
-        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer                                            { typedef R (O::*Type)(P1, P2, P3, P4, P5); };
-        template <class R, class O, class P1, class P2, class P3, class P4, class P5>               struct FunctionPointer<R, O, false, P1, P2, P3, P4, P5>           { typedef R (O::*Type)(P1, P2, P3, P4, P5); };
-        template <class R, class O, class P1, class P2, class P3, class P4>                         struct FunctionPointer<R, O, false, P1, P2, P3, P4, void>         { typedef R (O::*Type)(P1, P2, P3, P4); };
-        template <class R, class O, class P1, class P2, class P3>                                   struct FunctionPointer<R, O, false, P1, P2, P3, void, void>       { typedef R (O::*Type)(P1, P2, P3); };
-        template <class R, class O, class P1, class P2>                                             struct FunctionPointer<R, O, false, P1, P2, void, void, void>     { typedef R (O::*Type)(P1, P2); };
-        template <class R, class O, class P1>                                                       struct FunctionPointer<R, O, false, P1, void, void, void, void>   { typedef R (O::*Type)(P1); };
-        template <class R, class O>                                                                 struct FunctionPointer<R, O, false, void, void, void, void, void> { typedef R (O::*Type)(); };
-        template <class R, class O, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer<R, O, true, P1, P2, P3, P4, P5>           { typedef R (O::*Type)(P1, P2, P3, P4, P5) const; };
-        template <class R, class O, class P1, class P2, class P3, class P4>           struct FunctionPointer<R, O, true, P1, P2, P3, P4, void>         { typedef R (O::*Type)(P1, P2, P3, P4) const; };
-        template <class R, class O, class P1, class P2, class P3>                     struct FunctionPointer<R, O, true, P1, P2, P3, void, void>       { typedef R (O::*Type)(P1, P2, P3) const; };
-        template <class R, class O, class P1, class P2>                               struct FunctionPointer<R, O, true, P1, P2, void, void, void>     { typedef R (O::*Type)(P1, P2) const; };
-        template <class R, class O, class P1>                                         struct FunctionPointer<R, O, true, P1, void, void, void, void>   { typedef R (O::*Type)(P1) const; };
-        template <class R, class O>                                                   struct FunctionPointer<R, O, true, void, void, void, void, void> { typedef R (O::*Type)() const; };
-        template <class R, class P1, class P2, class P3, class P4, class P5> struct FunctionPointer<R, void, false, P1, P2, P3, P4, P5>           { typedef R (*Type)(P1, P2, P3, P4, P5); };
-        template <class R, class P1, class P2, class P3, class P4>           struct FunctionPointer<R, void, false, P1, P2, P3, P4, void>         { typedef R (*Type)(P1, P2, P3, P4); };
-        template <class R, class P1, class P2, class P3>                     struct FunctionPointer<R, void, false, P1, P2, P3, void, void>       { typedef R (*Type)(P1, P2, P3); };
-        template <class R, class P1, class P2>                               struct FunctionPointer<R, void, false, P1, P2, void, void, void>     { typedef R (*Type)(P1, P2); };
-        template <class R, class P1>                                         struct FunctionPointer<R, void, false, P1, void, void, void, void>   { typedef R (*Type)(P1); };
-        template <class R>                                                   struct FunctionPointer<R, void, false, void, void, void, void, void> { typedef R (*Type)(); };
-
-        // Helper class, used to call a function-pointer with a given object and parameters and to return its return-value (if available)
-        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller                                              { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (object->*functionPointer)(param1, param2, param3, param4, param5); } };
-        template <class R, class O, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<R, O, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType&) { return (object->*functionPointer)(param1, param2, param3, param4); } };
-        template <class R, class O, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<R, O, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType&, const MultiType&) { return (object->*functionPointer)(param1, param2, param3); } };
-        template <class R, class O, bool isconst, class P1, class P2>                               struct FunctorCaller<R, O, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, P2, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType&, const MultiType&, const MultiType&) { return (object->*functionPointer)(param1, param2); } };
-        template <class R, class O, bool isconst, class P1>                                         struct FunctorCaller<R, O, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, P1, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { return (object->*functionPointer)(param1); } };
-        template <class R, class O, bool isconst>                                                   struct FunctorCaller<R, O, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<R, O, isconst, void, void, void, void, void>::Type functionPointer, O* object, const MultiType&, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { return (object->*functionPointer)(); } };
-        template <class O, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<void, O, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (object->*functionPointer)(param1, param2, param3, param4, param5); return MultiType::Null; } };
-        template <class O, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<void, O, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, P4, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType&) { (object->*functionPointer)(param1, param2, param3, param4); return MultiType::Null; } };
-        template <class O, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<void, O, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, P3, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType&, const MultiType&) { (object->*functionPointer)(param1, param2, param3); return MultiType::Null; } };
-        template <class O, bool isconst, class P1, class P2>                               struct FunctorCaller<void, O, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, P2, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType& param2, const MultiType&, const MultiType&, const MultiType&) { (object->*functionPointer)(param1, param2); return MultiType::Null; } };
-        template <class O, bool isconst, class P1>                                         struct FunctorCaller<void, O, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, P1, void, void, void, void>::Type functionPointer, O* object, const MultiType& param1, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { (object->*functionPointer)(param1); return MultiType::Null; } };
-        template <class O, bool isconst>                                                   struct FunctorCaller<void, O, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<void, O, isconst, void, void, void, void, void>::Type functionPointer, O* object, const MultiType&, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { (object->*functionPointer)(); return MultiType::Null; } };
-        template <class R, bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<R, void, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, P4, P5>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { return (*functionPointer)(param1, param2, param3, param4, param5); } };
-        template <class R, bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<R, void, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, P4, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType&) { return (*functionPointer)(param1, param2, param3, param4); } };
-        template <class R, bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<R, void, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, P3, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType&, const MultiType&) { return (*functionPointer)(param1, param2, param3); } };
-        template <class R, bool isconst, class P1, class P2>                               struct FunctorCaller<R, void, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, P2, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType&, const MultiType&, const MultiType&) { return (*functionPointer)(param1, param2); } };
-        template <class R, bool isconst, class P1>                                         struct FunctorCaller<R, void, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, P1, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { return (*functionPointer)(param1); } };
-        template <class R, bool isconst>                                                   struct FunctorCaller<R, void, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<R, void, isconst, void, void, void, void, void>::Type functionPointer, void*, const MultiType&, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { return (*functionPointer)(); } };
-        template <bool isconst, class P1, class P2, class P3, class P4, class P5> struct FunctorCaller<void, void, isconst, P1, P2, P3, P4, P5>           { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, P4, P5>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) { (*functionPointer)(param1, param2, param3, param4, param5); return MultiType::Null; } };
-        template <bool isconst, class P1, class P2, class P3, class P4>           struct FunctorCaller<void, void, isconst, P1, P2, P3, P4, void>         { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, P4, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType&) { (*functionPointer)(param1, param2, param3, param4); return MultiType::Null; } };
-        template <bool isconst, class P1, class P2, class P3>                     struct FunctorCaller<void, void, isconst, P1, P2, P3, void, void>       { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, P3, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType&, const MultiType&) { (*functionPointer)(param1, param2, param3); return MultiType::Null; } };
-        template <bool isconst, class P1, class P2>                               struct FunctorCaller<void, void, isconst, P1, P2, void, void, void>     { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, P2, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType& param2, const MultiType&, const MultiType&, const MultiType&) { (*functionPointer)(param1, param2); return MultiType::Null; } };
-        template <bool isconst, class P1>                                         struct FunctorCaller<void, void, isconst, P1, void, void, void, void>   { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, P1, void, void, void, void>::Type functionPointer, void*, const MultiType& param1, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { (*functionPointer)(param1); return MultiType::Null; } };
-        template <bool isconst>                                                   struct FunctorCaller<void, void, isconst, void, void, void, void, void> { static inline MultiType call(typename detail::FunctionPointer<void, void, isconst, void, void, void, void, void>::Type functionPointer, void*, const MultiType&, const MultiType&, const MultiType&, const MultiType&, const MultiType&) { (*functionPointer)(); return MultiType::Null; } };
-
-        // Helper class, used to identify the header of a function-pointer (independent of its class)
-        template <class R, class P1, class P2, class P3, class P4, class P5>
-        struct FunctorHeaderIdentifier
-        {};
+        // Helper class to get the type of the function-pointer (or the function-object) with the given class, parameters, return-value, and constness
+        template <class F, class R, class O, bool isconst, class... Params> struct FunctionType /* generic type is undefined */;
+        template <         class R, class O,               class... Params> struct FunctionType<void, R, O,    false, Params...> { typedef R (O::*Type)(Params...); };       // spezialization: non-const member function
+        template <         class R, class O,               class... Params> struct FunctionType<void, R, O,    true,  Params...> { typedef R (O::*Type)(Params...) const; }; // spezialization: const member function
+        template <         class R,                        class... Params> struct FunctionType<void, R, void, false, Params...> { typedef R (*Type)(Params...); };          // spezialization: static function
+        template <class F, class R,                        class... Params> struct FunctionType<F,    R, void, false, Params...> { typedef F Type; };                        // spezialization: function object
+
+        // Helper class, used to call a function with a given object and parameters and to return its return-value (if available)
+        template <class F, class R, class O, bool isconst, class... Params> struct FunctorCaller /* generic type is undefined */;
+        template <         class R, class O, bool isconst, class... Params> struct FunctorCaller<void, R,    O,    isconst, Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<void, R,    O,    isconst, Params...>::Type functionPointer, O* object, const Params&... parameters, const UnusedParams&...) { return (object->*functionPointer)(parameters...); } };                  // spezialization: member function with return value
+        template <                  class O, bool isconst, class... Params> struct FunctorCaller<void, void, O,    isconst, Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<void, void, O,    isconst, Params...>::Type functionPointer, O* object, const Params&... parameters, const UnusedParams&...) { (object->*functionPointer)(parameters...); return MultiType::Null; } }; // spezialization: member function without return value
+        template <         class R,                        class... Params> struct FunctorCaller<void, R,    void, false,   Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<void, R,    void, false,   Params...>::Type functionPointer, void*,     const Params&... parameters, const UnusedParams&...) { return (*functionPointer)(parameters...); } };                          // spezialization: static function with return value
+        template <                                         class... Params> struct FunctorCaller<void, void, void, false,   Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<void, void, void, false,   Params...>::Type functionPointer, void*,     const Params&... parameters, const UnusedParams&...) { (*functionPointer)(parameters...); return MultiType::Null; } };         // spezialization: static function without return value
+        template <class F, class R,                        class... Params> struct FunctorCaller<F,    R,    void, false,   Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<F,    R,    void, false,   Params...>::Type functor,         void*,     const Params&... parameters, const UnusedParams&...) { return functor(parameters...); } };                                     // spezialization: function object with return value
+        template <class F,                                 class... Params> struct FunctorCaller<F,    void, void, false,   Params...> { template <class... UnusedParams> static inline MultiType call(typename detail::FunctionType<F,    void, void, false,   Params...>::Type functor,         void*,     const Params&... parameters, const UnusedParams&...) { functor(parameters...); return MultiType::Null; } };                    // spezialization: function object without return value
 
         // Helper class to determine if a function has a returnvalue
@@ -448,23 +410,43 @@
         { enum { result = false }; };
 
-        // Helper class to count the number of parameters
-        template <class P1, class P2, class P3, class P4, class P5>
-        struct FunctorParamCount
-        { enum { result = 5 }; };
-        template <class P1, class P2, class P3, class P4>
-        struct FunctorParamCount<P1, P2, P3, P4, void>
-        { enum { result = 4 }; };
-        template <class P1, class P2, class P3>
-        struct FunctorParamCount<P1, P2, P3, void, void>
-        { enum { result = 3 }; };
-        template <class P1, class P2>
-        struct FunctorParamCount<P1, P2, void, void, void>
-        { enum { result = 2 }; };
-        template <class P1>
-        struct FunctorParamCount<P1, void, void, void, void>
-        { enum { result = 1 }; };
+        // Helper class to determine the N-th parameter of a variadic template (with 0 being the index of the first parameter)
+        template <int n, typename T = void, typename... Other>
+        struct GetNthParamType
+        { typedef typename GetNthParamType<n - 1, Other...>::Type Type; };
+        template <typename T, typename... Other>
+        struct GetNthParamType<0, T, Other...>
+        { typedef T Type; };
+
+        // Helper structs to deduce the first N types of a parameter pack
+        template<class... Types> struct type_list {};
+
+        template <class T1, class... AllTypes>
+        struct make_type_list_helper
+        {
+            template <std::size_t N, class... Types>
+            struct make_type_list_impl : make_type_list_helper<AllTypes...>::template make_type_list_impl<N - 1, Types..., T1> {};
+
+            template <class... Types>
+            struct make_type_list_impl<1u, Types...> : type_list<Types..., T1> {};
+        };
+
+        template <class T1>
+        struct make_type_list_helper<T1>
+        {
+            template <std::size_t N, class... Types>
+            struct make_type_list_impl : type_list<Types..., T1> {};
+        };
+
+        template <std::size_t N, class... Types>
+        struct make_type_list : make_type_list_helper<Types...>::template make_type_list_impl<N> {};
+
+        template <class... Types>
+        struct make_type_list<0u, Types...> : type_list<> {};
+
+        template <std::size_t N>
+        struct make_type_list<N> : type_list<> {};
+
         template <>
-        struct FunctorParamCount<void, void, void, void, void>
-        { enum { result = 0 }; };
+        struct make_type_list<0u> : type_list<> {};
     }
 
@@ -473,12 +455,9 @@
         that need to know the exact types of the parameters, return-value, and class.
 
+        @param F the type of the function-object (or void if a function-pointer is used).
         @param R The type of the return-value of the function
         @param O The class of the function
         @param isconst True if the function is a const member-function
-        @param P1 The type of the first parameter
-        @param P2 The type of the second parameter
-        @param P3 The type of the third parameter
-        @param P4 The type of the fourth parameter
-        @param P5 The type of the fifth parameter
+        @param Params The types of the parameters
 
         This template has many parameters and is usually not used directly. It is created by
@@ -489,44 +468,46 @@
         All template arguments can be void.
     */
-    template <class R, class O, bool isconst, class P1, class P2, class P3, class P4, class P5>
-    class FunctorTemplate : public FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>
-    {
+    template <class F, class R, class O, bool isconst, class... Params>
+    class FunctorTemplate : public FunctorPointer<typename detail::FunctionType<F, R, O, isconst, Params...>::Type, O>
+    {
+        static_assert(sizeof...(Params) <= 5, "Only up to 5 parameters are supported");
+
         public:
             /// Constructor: Initializes the base class.
-            FunctorTemplate(typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type functionPointer, O* object = 0) : FunctorPointer<typename detail::FunctionPointer<R, O, isconst, P1, P2, P3, P4, P5>::Type, O>(functionPointer, object) {}
+            FunctorTemplate(typename detail::FunctionType<F, R, O, isconst, Params...>::Type functionPointer, O* object = nullptr) : FunctorPointer<typename detail::FunctionType<F, R, O, isconst, Params...>::Type, O>(functionPointer, object) {}
 
             // see FunctorMember::operator()()
-            MultiType operator()(O* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null)
-            {
-                return detail::FunctorCaller<R, O, isconst, P1, P2, P3, P4, P5>::call(this->functionPointer_, object, param1, param2, param3, param4, param5);
+            virtual MultiType operator()(O* object, const MultiType& param1 = MultiType::Null, const MultiType& param2 = MultiType::Null, const MultiType& param3 = MultiType::Null, const MultiType& param4 = MultiType::Null, const MultiType& param5 = MultiType::Null) override
+            {
+                return detail::FunctorCaller<F, R, O, isconst, Params...>::call(this->functionPointer_, object, param1, param2, param3, param4, param5);
             }
 
             // see Functor::clone()
-            FunctorPtr clone()
-            {
-                return new FunctorTemplate(*this);
+            virtual FunctorPtr clone() override
+            {
+                return std::make_shared<FunctorTemplate>(*this);
             }
 
             // see Functor::evaluateArgument()
-            void evaluateArgument(unsigned int index, MultiType& argument) const
+            virtual void evaluateArgument(unsigned int index, MultiType& argument) const override
             {
                 switch (index)
                 {
-                    case 0: argument.convert<P1>(); break;
-                    case 1: argument.convert<P2>(); break;
-                    case 2: argument.convert<P3>(); break;
-                    case 3: argument.convert<P4>(); break;
-                    case 4: argument.convert<P5>(); break;
+                    case 0: argument.convert<typename detail::GetNthParamType<0, Params...>::Type>(); break;
+                    case 1: argument.convert<typename detail::GetNthParamType<1, Params...>::Type>(); break;
+                    case 2: argument.convert<typename detail::GetNthParamType<2, Params...>::Type>(); break;
+                    case 3: argument.convert<typename detail::GetNthParamType<3, Params...>::Type>(); break;
+                    case 4: argument.convert<typename detail::GetNthParamType<4, Params...>::Type>(); break;
                 }
             }
 
             // see Functor::getParamCount()
-            unsigned int getParamCount() const
-            {
-                return detail::FunctorParamCount<P1, P2, P3, P4, P5>::result;
+            virtual unsigned int getParamCount() const override
+            {
+                return sizeof...(Params);
             }
 
             // see Functor::hasReturnvalue()
-            bool hasReturnvalue() const
+            virtual bool hasReturnvalue() const override
             {
                 return detail::FunctorHasReturnvalue<R>::result;
@@ -534,13 +515,13 @@
 
             // see Functor::getTypenameParam()
-            std::string getTypenameParam(unsigned int index) const
+            virtual std::string getTypenameParam(unsigned int index) const override
             {
                 switch (index)
                 {
-                    case 0:  return typeToString<P1>();
-                    case 1:  return typeToString<P2>();
-                    case 2:  return typeToString<P3>();
-                    case 3:  return typeToString<P4>();
-                    case 4:  return typeToString<P5>();
+                    case 0:  return typeToString<typename detail::GetNthParamType<0, Params...>::Type>();
+                    case 1:  return typeToString<typename detail::GetNthParamType<1, Params...>::Type>();
+                    case 2:  return typeToString<typename detail::GetNthParamType<2, Params...>::Type>();
+                    case 3:  return typeToString<typename detail::GetNthParamType<3, Params...>::Type>();
+                    case 4:  return typeToString<typename detail::GetNthParamType<4, Params...>::Type>();
                     default: return "";
                 }
@@ -548,62 +529,66 @@
 
             // see Functor::getTypenameReturnvalue()
-            std::string getTypenameReturnvalue() const
+            virtual std::string getTypenameReturnvalue() const override
             {
                 return typeToString<R>();
             }
 
+            // see Functor::getFullIdentifier()
+            virtual const std::type_info& getFullIdentifier() const override
+            {
+                return typeid(typename detail::FunctionType<void, R, O, isconst, Params...>::Type);
+            }
+
             // see Functor::getHeaderIdentifier()
-            const std::type_info& getHeaderIdentifier() const
-            {
-                return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, P3, P4, P5>);
+            virtual const std::type_info& getHeaderIdentifier() const override
+            {
+                return typeid(typename detail::FunctionType<void, R, void, false, Params...>::Type);
             }
 
             // see Functor::getHeaderIdentifier(unsigned int)
-            const std::type_info& getHeaderIdentifier(unsigned int params) const
+            virtual const std::type_info& getHeaderIdentifier(unsigned int params) const override
             {
                 switch (params)
                 {
-                    case 0:  return typeid(detail::FunctorHeaderIdentifier<R, void, void, void, void, void>);
-                    case 1:  return typeid(detail::FunctorHeaderIdentifier<R, P1, void, void, void, void>);
-                    case 2:  return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, void, void, void>);
-                    case 3:  return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, P3, void, void>);
-                    case 4:  return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, P3, P4, void>);
-                    default: return typeid(detail::FunctorHeaderIdentifier<R, P1, P2, P3, P4, P5>);
+                    case 0:  return this->getTypelistIdentifier(detail::make_type_list<0, Params...>{});
+                    case 1:  return this->getTypelistIdentifier(detail::make_type_list<1, Params...>{});
+                    case 2:  return this->getTypelistIdentifier(detail::make_type_list<2, Params...>{});
+                    case 3:  return this->getTypelistIdentifier(detail::make_type_list<3, Params...>{});
+                    case 4:  return this->getTypelistIdentifier(detail::make_type_list<4, Params...>{});
+                    default: return this->getTypelistIdentifier(detail::make_type_list<5, Params...>{});
                 }
             }
+
+    private:
+            /// Helper function that deduces a parameter pack of types and returns the corresponding identifier
+            template<class... Types>
+            const std::type_info& getTypelistIdentifier(detail::type_list<Types...>) const
+            {
+                return typeid(typename detail::FunctionType<void, R, void, false, Types...>::Type);
+            }
     };
 
-    template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5), OO* object) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2, class P3, class P4>           inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4), OO* object)     { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2, class P3>                     inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3), OO* object)         { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2>                               inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2), OO* object)             { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1>                                         inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1), OO* object)                 { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO>                                                   inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(), OO* object)                   { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const, OO* object) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2, class P3, class P4>           inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const, OO* object)     { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2, class P3>                     inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const, OO* object)         { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1, class P2>                               inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const, OO* object)             { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO, class P1>                                         inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const, OO* object)                 { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-    template <class R, class O, class OO>                                                   inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const, OO* object)                   { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer, object); }   ///< Creates a new FunctorMember with the given function-pointer and an assigned object
-
-    template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, P5>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2, class P3, class P4>           inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4))     { return new FunctorTemplate<R, O, false, P1, P2, P3, P4, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2, class P3>                     inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3))         { return new FunctorTemplate<R, O, false, P1, P2, P3, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2>                               inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2))             { return new FunctorTemplate<R, O, false, P1, P2, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1>                                         inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1))                 { return new FunctorTemplate<R, O, false, P1, void, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O>                                                   inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)())                   { return new FunctorTemplate<R, O, false, void, void, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2, class P3, class P4, class P5> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4, P5) const) { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, P5>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2, class P3, class P4>           inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3, P4) const)     { return new FunctorTemplate<R, O, true, P1, P2, P3, P4, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2, class P3>                     inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2, P3) const)         { return new FunctorTemplate<R, O, true, P1, P2, P3, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1, class P2>                               inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1, P2) const)             { return new FunctorTemplate<R, O, true, P1, P2, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O, class P1>                                         inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(P1) const)                 { return new FunctorTemplate<R, O, true, P1, void, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-    template <class R, class O>                                                   inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)() const)                   { return new FunctorTemplate<R, O, true, void, void, void, void, void>(functionPointer); }   ///< Creates a new FunctorMember with the given function-pointer
-
-    template <class R, class P1, class P2, class P3, class P4, class P5> inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4, P5)) { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, P5>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
-    template <class R, class P1, class P2, class P3, class P4>           inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3, P4))     { return new FunctorTemplate<R, void, false, P1, P2, P3, P4, void>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
-    template <class R, class P1, class P2, class P3>                     inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2, P3))         { return new FunctorTemplate<R, void, false, P1, P2, P3, void, void>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
-    template <class R, class P1, class P2>                               inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1, P2))             { return new FunctorTemplate<R, void, false, P1, P2, void, void, void>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
-    template <class R, class P1>                                         inline FunctorStaticPtr createFunctor(R (*functionPointer)(P1))                 { return new FunctorTemplate<R, void, false, P1, void, void, void, void>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
-    template <class R>                                                   inline FunctorStaticPtr createFunctor(R (*functionPointer)())                   { return new FunctorTemplate<R, void, false, void, void, void, void, void>(functionPointer); }   ///< Creates a new Functor with the given function-pointer
+
+    namespace detail
+    {
+        // Helper functions to deduce types and constness of operator() and return the correct FunctorTemplate
+        template <class F>
+        struct CallableHelper
+        {
+            template <class R, class... Params> static inline FunctorStaticPtr create(const F& functionObject, R(F::*)(Params...))       { return std::make_shared<FunctorTemplate<F, R, void, false, Params...>>(functionObject); }
+            template <class R, class... Params> static inline FunctorStaticPtr create(const F& functionObject, R(F::*)(Params...) const) { return std::make_shared<FunctorTemplate<F, R, void, false, Params...>>(functionObject); } // note: both const and non-const function-objects are treated as static functors with isconst=false.
+        };
+    }
+
+    template <class R, class O, class OO, class... Params> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(Params...),       OO* object) { return std::make_shared<FunctorTemplate<void, R, O, false, Params...>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object
+    template <class R, class O, class OO, class... Params> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(Params...) const, OO* object) { return std::make_shared<FunctorTemplate<void, R, O, true,  Params...>>(functionPointer, object); } ///< Creates a new FunctorMember with the given function-pointer and an assigned object
+
+    template <class R, class O, class... Params> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(Params...))       { return std::make_shared<FunctorTemplate<void, R, O, false, Params...>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer
+    template <class R, class O, class... Params> inline FunctorMemberPtr<O> createFunctor(R (O::*functionPointer)(Params...) const) { return std::make_shared<FunctorTemplate<void, R, O, true,  Params...>>(functionPointer); } ///< Creates a new FunctorMember with the given function-pointer
+
+    template <class R, class... Params> inline FunctorStaticPtr createFunctor(R (*functionPointer)(Params...)) { return std::make_shared<FunctorTemplate<void, R, void, false, Params...>>(functionPointer); } ///< Creates a new FunctorStatic with the given function-pointer
+
+    /** Take care that this functor does not outlive objects that have been captured by reference in a lambda. */
+    template <class F> inline FunctorStaticPtr createFunctor(const F& functionObject) { return detail::CallableHelper<F>::create(functionObject, &F::operator()); } ///< Creates a new Functor with a callable object
 }
 
