view: make container constructor explicit and constexpr
This commit is contained in:
parent
722dbbe18f
commit
ba2c74449f
3
view.hpp
3
view.hpp
@ -36,6 +36,9 @@ namespace util {
|
||||
constexpr
|
||||
view (T first, T last) noexcept;
|
||||
|
||||
template <typename K> constexpr explicit view ( K &klass);
|
||||
template <typename K> constexpr explicit view (const K &klass);
|
||||
|
||||
constexpr T& begin (void) noexcept;
|
||||
constexpr T& end (void) noexcept;
|
||||
|
||||
|
20
view.ipp
20
view.ipp
@ -46,6 +46,26 @@ util::view<T>::view (T _begin, T _end) noexcept:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
template <typename K>
|
||||
constexpr
|
||||
util::view<T>::view (K &data):
|
||||
m_begin (std::begin (data)),
|
||||
m_end (std::end (data))
|
||||
{ ; }
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
template <typename K>
|
||||
constexpr
|
||||
util::view<T>::view (const K &data):
|
||||
m_begin (std::begin (data)),
|
||||
m_end (std::end (data))
|
||||
{ ; }
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename T>
|
||||
constexpr T&
|
||||
util::view<T>::begin (void) noexcept
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user