struct Apply<I>
{
template<typename L, typename F, typename... Args>
- static void apply(L &l, F func, const Statement &, Args... args)
+ static void apply(L &l, F func, const Statement &, Args &&... args)
{
- (l.*func)(args...);
+ (l.*func)(std::forward<Args>(args)...);
}
template<typename L, typename F, typename... Args>
- static void apply(L &l, F func, const ArgumentStore &, Args... args)
+ static void apply(L &l, F func, const ArgumentStore &, Args &&... args)
{
- (l.*func)(args...);
+ (l.*func)(std::forward<Args>(args)...);
}
};
struct Apply<I, Head, Tail...>
{
template<typename L, typename F, typename... Args>
- static void apply(L &l, F func, const Statement &st, Args... 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>());
+ Apply<I+1, Tail...>::apply(l, func, st, std::forward<Args>(args)..., std::move(st.args[I].get<Head>()));
}
template<typename L, typename F, typename... Args>
- static void apply(L &l, F func, const ArgumentStore &as, Args... 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));
+ Apply<I+1, Tail...>::apply(l, func, as, std::forward<Args>(args)..., std::move(as.get<Head>(I)));
}
};
Bound0Type bound0;
public:
- LoaderFuncNBound1(FuncType f, const Bound0Type &b0): func(f), bound0(b0) { }
+ LoaderFuncNBound1(FuncType f, const B0 &b0): func(f), bound0(b0) { }
+ LoaderFuncNBound1(FuncType f, B0 &&b0): func(f), bound0(std::move(b0)) { }
virtual void execute(Loader &l, const Statement &st) const
{