view: prefer construction using explicit size over pointer arithmetic
This simplifies step through debugging on some containers.
This commit is contained in:
parent
591a321f47
commit
c383f6579f
4
view.hpp
4
view.hpp
@ -186,7 +186,7 @@ namespace cruft {
|
||||
//---------------------------------------------------------------------
|
||||
template <typename ValueT, typename AllocatorT>
|
||||
view (const std::vector<ValueT,AllocatorT> &rhs):
|
||||
view (std::data (rhs), std::data (rhs) + std::size (rhs))
|
||||
view (std::data (rhs), std::size (rhs))
|
||||
{ ; }
|
||||
|
||||
|
||||
@ -207,7 +207,7 @@ namespace cruft {
|
||||
//---------------------------------------------------------------------
|
||||
template <typename ValueT, std::size_t N>
|
||||
view (const std::array<ValueT,N> &rhs):
|
||||
view (std::data (rhs), std::data (rhs) + std::size (rhs))
|
||||
view (std::data (rhs), std::size (rhs))
|
||||
{ ; }
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user