tuple: remove `call' as it now duplicates std::apply
This commit is contained in:
parent
17816021b9
commit
3a4f6ffce8
30
tuple.hpp
30
tuple.hpp
@ -66,36 +66,6 @@ namespace util::tuple {
|
||||
{ return for_type<decltype(t)> (f); }
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// unpack a tuple as function arguments
|
||||
namespace detail {
|
||||
template <
|
||||
typename Func,
|
||||
typename ...Args,
|
||||
size_t ...I
|
||||
>
|
||||
auto
|
||||
call (const Func &func, std::tuple<Args...> args, std::index_sequence<I...>)
|
||||
{
|
||||
// quiet unused variable warning with zero args
|
||||
(void)args;
|
||||
|
||||
// XXX: Use `std::invoke' when gcc catches up with c++17
|
||||
return func (std::get<I> (args)...);
|
||||
}
|
||||
}
|
||||
|
||||
template <
|
||||
typename Func,
|
||||
typename ...Args
|
||||
>
|
||||
auto
|
||||
call (const Func &func, std::tuple<Args...> args)
|
||||
{
|
||||
return detail::call (func, args, std::make_index_sequence<sizeof...(Args)> {});
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/// call a provided object with each value in a tuple
|
||||
template <
|
||||
|
Loading…
Reference in New Issue
Block a user