diff --git a/g2log/src/g2sinkhandle.hpp b/g2log/src/g2sinkhandle.hpp index 115cbed..e09f767 100644 --- a/g2log/src/g2sinkhandle.hpp +++ b/g2log/src/g2sinkhandle.hpp @@ -36,10 +36,10 @@ namespace g2 { // the returned future will contain a bad_weak_ptr exception instead of the // call result. template - auto call(AsyncCall func , Args... args) -> std::future::type> { + auto call(AsyncCall func , Args&&... args) -> std::future::type> { try { std::shared_ptr> sink(_sink); - return sink->async(func, args...); + return sink->async(func, std::forward(args)...); } catch (const std::bad_weak_ptr& e) { typedef typename std::result_of::type PromiseType; std::promise promise;