From 33d6378e0190d6b8be4a7b6a99aa0e5f820309c5 Mon Sep 17 00:00:00 2001 From: KjellKod Date: Sat, 12 Apr 2014 00:18:30 -0600 Subject: [PATCH] std::forward arguments. Actually this helped in reducing worst case performance --- g2log/src/g2sinkhandle.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;