tuple: add query for nth parameter pack value
This commit is contained in:
parent
82a8446e10
commit
007add45f2
@ -208,6 +208,15 @@ namespace util::tuple {
|
||||
struct index<T,std::tuple<U, Types...>> {
|
||||
static constexpr std::size_t value = 1 + index<T, std::tuple<Types...>>::value;
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
template <std::size_t Idx, typename ...Args>
|
||||
auto
|
||||
nth (Args &&...args)
|
||||
{
|
||||
return std::get<Idx> (std::tuple {std::forward<Args> (args)...});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user