From 30686fdf8240c71276de7659b851231207f4a572 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 22 Sep 2014 03:43:36 +0200 Subject: [PATCH] fix argument passing for MultiFact(#388) as always, it turned out that the alledged "compiler bug" rather was my own sloppyness: I forgot properly to undo a change I made while fighting with compilation problems: the wrapper in the factory didn't use std::forward, resulting in a plain flat slicing copy. This, rightfully, triggered the assertion in the session query resolver (since a sliced Goal can not be dynamic cast to a specific Query subclass). --- src/lib/multifact.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/multifact.hpp b/src/lib/multifact.hpp index 37b6fdb79..24dab5128 100644 --- a/src/lib/multifact.hpp +++ b/src/lib/multifact.hpp @@ -95,9 +95,9 @@ namespace lib { template ResultType - wrap (FUN create, ARGS... args) noexcept + wrap (FUN create, ARGS&&... args) noexcept { - return create(args...); + return create(std::forward(args)...); } }; @@ -115,9 +115,9 @@ namespace lib { template ResultType - wrap (FUN create, ARGS... args) + wrap (FUN create, ARGS&&... args) { - return ResultType (create(args...)); + return ResultType (create(std::forward(args)...)); } }; @@ -155,7 +155,7 @@ namespace lib { ResultType wrap (FUN create, ARGS&&... args) { - return wrapper_(std::forward (create(args...))); + return wrapper_(std::forward (create(std::forward(args)...))); } private: