tuple/value: forward the arguments from map to the helper function

This commit is contained in:
Danny Robson 2019-03-18 13:53:52 +11:00
parent 1f1f6ddbaf
commit 34ab275578

View File

@ -46,7 +46,9 @@ namespace cruft::tuple::value {
auto
map (std::index_sequence<Indices...>, FuncT &&func, ArgT &&arg)
{
return std::tuple (std::invoke (func, std::get<Indices> (arg))...);
return std::tuple (
std::invoke (func, std::get<Indices> (arg))...
);
}
};
@ -62,7 +64,11 @@ namespace cruft::tuple::value {
>
auto map (FuncT &&func, ArgT &&arg)
{
return detail::map (IndicesV{}, func, arg);
return detail::map (
IndicesV{},
std::forward<FuncT> (func),
std::forward<ArgT> (arg)
);
}