array/varray: allow construction from containers
This commit is contained in:
parent
2f6c845409
commit
7746463c5a
@ -40,13 +40,22 @@ namespace cruft {
|
|||||||
: m_data (std::data (rhs))
|
: m_data (std::data (rhs))
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
varray (std::array<T,S> &&) = delete;
|
varray (std::array<T,S> &&) = delete;
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
varray (T (&_data)[S])
|
varray (T (&_data)[S])
|
||||||
: m_data (_data)
|
: m_data (_data)
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
template <typename ContainerT>
|
||||||
|
varray (ContainerT &_container)
|
||||||
|
: varray (_container.data ())
|
||||||
|
{ CHECK_GE (_container.size (), size ()); }
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
std::size_t size (void) const { return S; }
|
std::size_t size (void) const { return S; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user