view: add more assertions for valid consume parameters
This commit is contained in:
parent
5724de752e
commit
4b9b292848
4
view.hpp
4
view.hpp
@ -339,9 +339,11 @@ namespace util {
|
|||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
[[nodiscard]] constexpr util::view<BeginT,EndT>
|
[[nodiscard]] constexpr util::view<BeginT,EndT>
|
||||||
consume (util::view<BeginT,BeginT> prefix) const
|
consume (util::view<BeginT,EndT> prefix) const
|
||||||
{
|
{
|
||||||
assert (prefix.begin () == begin ());
|
assert (prefix.begin () == begin ());
|
||||||
|
assert (prefix.end () < end ());
|
||||||
|
|
||||||
return { prefix.end (), end () };
|
return { prefix.end (), end () };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user