mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-18 23:57:39 +08:00
Added missing array_get method for numeric_list
This commit is contained in:
parent
7ad37606dd
commit
7fe704596a
@ -123,6 +123,10 @@ template<typename a, typename... as> struct get<0, type_lis
|
||||
template<typename T, int n, T a, T... as> struct get<n, numeric_list<T, a, as...>> : get<n-1, numeric_list<T, as...>> {};
|
||||
template<typename T, T a, T... as> struct get<0, numeric_list<T, a, as...>> { constexpr static T value = a; };
|
||||
|
||||
template<std::size_t n, typename T, T a, T... as> constexpr inline const T array_get(const numeric_list<T, a, as...>& l) {
|
||||
return get<(int)n, numeric_list<T, a, as...>>::value;
|
||||
}
|
||||
|
||||
/* always get type, regardless of dummy; good for parameter pack expansion */
|
||||
|
||||
template<typename T, T dummy, typename t> struct id_numeric { typedef t type; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user