types: add elems implementation for container types
This commit is contained in:
parent
f7a1ead518
commit
e12edc6c0a
@ -25,10 +25,17 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
/// Returns the number of elements of a statically allocated array
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t elems(const T (&)[N])
|
||||
constexpr size_t
|
||||
elems (const T (&)[N])
|
||||
{ return N; }
|
||||
|
||||
|
||||
template <typename T>
|
||||
constexpr typename T::size_type
|
||||
elems (const T &t)
|
||||
{ return t.size (); }
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
T
|
||||
|
Loading…
Reference in New Issue
Block a user