+#if __cplusplus>=201103L
+template<unsigned I, typename... Args>
+struct Apply;
+
+template<unsigned I>
+struct Apply<I>
+{
+ template<typename L, typename F, typename... Args>
+ static void apply(L &l, F func, const Statement &, Args... args)
+ {
+ (l.*func)(args...);
+ }
+
+ template<typename L, typename F, typename... Args>
+ static void apply(L &l, F func, const ArgumentStore &, Args... args)
+ {
+ (l.*func)(args...);
+ }
+};
+
+template<unsigned I, typename Head, typename... Tail>
+struct Apply<I, Head, Tail...>
+{
+ template<typename L, typename F, typename... Args>
+ static void apply(L &l, F func, const Statement &st, Args... args)
+ {
+ Apply<I+1, Tail...>::apply(l, func, st, args..., st.args[I].get<Head>());
+ }
+
+ template<typename L, typename F, typename... Args>
+ static void apply(L &l, F func, const ArgumentStore &as, Args... args)
+ {
+ Apply<I+1, Tail...>::apply(l, func, as, args..., as.get<Head>(I));
+ }
+};
+
+
+template<typename L, typename... Args>
+class LoaderFuncN: public LoaderAction
+{
+protected:
+ typedef void (L::*FuncType)(Args...);
+
+ FuncType func;
+
+public:
+ LoaderFuncN(FuncType f): func(f) { }
+
+ virtual void execute(Loader &l, const Statement &st) const
+ {
+ Apply<0, Args...>::apply(dynamic_cast<L &>(l), func, st);
+ }
+
+ virtual void execute(Loader &l, const ArgumentStore &as) const
+ {
+ Apply<0, Args...>::apply(dynamic_cast<L &>(l), func, as);
+ }
+
+ virtual std::string get_signature() const
+ { return create_signature<Args...>(); }
+};
+
+
+template<typename L, typename B0, typename... Args>
+class LoaderFuncNBound1: public LoaderAction
+{
+protected:
+ typedef void (L::*FuncType)(B0, Args...);
+ typedef typename RemoveReference<B0>::Type Bound0Type;
+
+ FuncType func;
+ Bound0Type bound0;
+
+public:
+ LoaderFuncNBound1(FuncType f, const Bound0Type &b0): func(f), bound0(b0) { }
+
+ virtual void execute(Loader &l, const Statement &st) const
+ {
+ Apply<0, Args...>::apply(dynamic_cast<L &>(l), func, st, bound0);
+ }
+
+ virtual void execute(Loader &l, const ArgumentStore &as) const
+ {
+ Apply<0, Args...>::apply(dynamic_cast<L &>(l), func, as, bound0);
+ }
+
+ virtual std::string get_signature() const
+ { return create_signature<Args...>(); }
+};
+#endif
+
+