X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Floaderaction.h;h=23298428df659303185075b212c7ada5604d6778;hb=fbe7e81c08a6b5a3f9ccdcbeb4dd4d351a5f4226;hp=9d5baae63aa4de770a70eb7ef7a99f05f1099d43;hpb=e14c01b5775dd2e324b16ff49498db9b9113c523;p=libs%2Fdatafile.git diff --git a/source/loaderaction.h b/source/loaderaction.h index 9d5baae..2329842 100644 --- a/source/loaderaction.h +++ b/source/loaderaction.h @@ -174,15 +174,15 @@ template struct Apply { template - 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)...); } template - 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)...); } }; @@ -190,15 +190,15 @@ template struct Apply { template - 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::apply(l, func, st, args..., st.args[I].get()); + Apply::apply(l, func, st, std::forward(args)..., std::move(st.args[I].get())); } template - 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::apply(l, func, as, args..., as.get(I)); + Apply::apply(l, func, as, std::forward(args)..., std::move(as.get(I))); } }; @@ -240,7 +240,8 @@ protected: 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 {