Index: /code/branches/cpp11_v2/src/libraries/core/command/Functor.h
===================================================================
--- /code/branches/cpp11_v2/src/libraries/core/command/Functor.h	(revision 10980)
+++ /code/branches/cpp11_v2/src/libraries/core/command/Functor.h	(revision 10981)
@@ -415,4 +415,12 @@
         { enum { result = false }; };
 
+        // 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; };
+
         //Barebones implementation of (make_)index_sequence for C++11
         template <std::size_t...> struct index_sequence {};
@@ -437,4 +445,11 @@
         };
 
+        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> {};
@@ -442,4 +457,10 @@
         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 make_type_list<0u> : type_list<> {};
     }
 
@@ -485,8 +506,11 @@
             virtual void evaluateArgument(unsigned int index, MultiType& argument) const override
             {
-                static const std::array<std::function<bool(MultiType&)>, sizeof...(Params)> funcs = {&MultiType::convert<Params>...};
-                if (index < funcs.size())
+                switch (index)
                 {
-                    funcs[index](argument);
+                    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;
                 }
             }
@@ -507,10 +531,13 @@
             virtual std::string getTypenameParam(unsigned int index) const override
             {
-                static const std::array<std::string, sizeof...(Params)> names = { typeToString<Params>()... };
-                if (index >= names.size())
+                switch (index)
                 {
-                    return "";
+                    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 "";
                 }
-                return names[index];
             }
 
@@ -530,10 +557,16 @@
             virtual const std::type_index getHeaderIdentifier(unsigned int params) const override
             {
-                //+1 because e.g. for two parameters, we want typeids for zero, one, or two parameters
-                return getHeaderIdentifierHelper(params, detail::make_index_sequence<sizeof...(Params) + 1>{});
+                switch (params)
+                {
+                    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 extracts index numbers of parameters from a tuple. Needed to call the function pointer with the correct amount of arguments.
             template<typename Tup, std::size_t... index>
@@ -541,16 +574,4 @@
             {
                 return detail::FunctorCaller<R, O, isconst, Params...>::call(this->functionPointer_, object, std::get<index>(std::forward<Tup>(tup))...);
-            }
-
-            /// Helper function to extract all identifiers of the function pointer using a deduced index sequence
-            template<std::size_t... index>
-            const std::type_index& getHeaderIdentifierHelper(unsigned int params, detail::index_sequence<index...>) const
-            {
-                static const std::array<const std::type_index, sizeof...(index)> typeinfos = { getTypelistIdentifier(detail::make_type_list<index, Params...>{})... };
-                if (params >= typeinfos.size())
-                {
-                    return typeinfos.back();
-                }
-                return typeinfos[params];
             }
 
