tuple/value: map should return return a forwarding tuple

This allows us to maintain references, rather than provoke copies.
This commit is contained in:
Danny Robson 2020-02-25 12:02:53 +11:00
parent a25a16e00e
commit ebb99a6f4e

View File

@ -144,7 +144,7 @@ namespace cruft::tuple::value {
auto
map (std::index_sequence<Indices...>, FuncT &&func, ArgT &&arg)
{
return std::tuple (
return std::forward_as_tuple (
std::invoke (func, std::get<Indices> (arg))...
);
}