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).
This commit is contained in:
Fischlurch 2014-09-22 03:43:36 +02:00
parent 059dbd8c75
commit 30686fdf82

View file

@ -95,9 +95,9 @@ namespace lib {
template<class FUN, typename... ARGS>
ResultType
wrap (FUN create, ARGS... args) noexcept
wrap (FUN create, ARGS&&... args) noexcept
{
return create(args...);
return create(std::forward<ARGS>(args)...);
}
};
@ -115,9 +115,9 @@ namespace lib {
template<class FUN, typename... ARGS>
ResultType
wrap (FUN create, ARGS... args)
wrap (FUN create, ARGS&&... args)
{
return ResultType (create(args...));
return ResultType (create(std::forward<ARGS>(args)...));
}
};
@ -155,7 +155,7 @@ namespace lib {
ResultType
wrap (FUN create, ARGS&&... args)
{
return wrapper_(std::forward<BareType> (create(args...)));
return wrapper_(std::forward<BareType> (create(std::forward<ARGS>(args)...)));
}
private: