Mark test range helpers' begin()/end() noexcept
GCC 16 with -Werror=noexcept rejects std::begin/std::end and std::ranges::begin/end on the test helpers whose begin()/end() are not noexcept. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
1 file changed
+6
-6
@@ -79,11 +79,11 @@ struct span_like
|
|||||||
T* first;
|
T* first;
|
||||||
T* last;
|
T* last;
|
||||||
|
|
||||||
T* begin() const
|
T* begin() const noexcept
|
||||||
{
|
{
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
T* end() const
|
T* end() const noexcept
|
||||||
{
|
{
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
@@ -103,11 +103,11 @@ struct map_span_like
|
|||||||
value_type* first;
|
value_type* first;
|
||||||
value_type* last;
|
value_type* last;
|
||||||
|
|
||||||
value_type* begin() const
|
value_type* begin() const noexcept
|
||||||
{
|
{
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
value_type* end() const
|
value_type* end() const noexcept
|
||||||
{
|
{
|
||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
@@ -118,11 +118,11 @@ struct mutable_only_range
|
|||||||
{
|
{
|
||||||
std::vector<std::string> values;
|
std::vector<std::string> values;
|
||||||
|
|
||||||
std::vector<std::string>::iterator begin()
|
std::vector<std::string>::iterator begin() noexcept
|
||||||
{
|
{
|
||||||
return values.begin();
|
return values.begin();
|
||||||
}
|
}
|
||||||
std::vector<std::string>::iterator end()
|
std::vector<std::string>::iterator end() noexcept
|
||||||
{
|
{
|
||||||
return values.end();
|
return values.end();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user