Declare hash_frame's constructor noexcept

GCC's -Wnoexcept (an error in CI) flags the emplace_back() into the
hash stack under C++26: the constructor cannot throw, since cbegin() is
noexcept, but it did not say so. dump_frame's constructor is noexcept
for the same reason.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-23 22:39:29 +02:00
parent fc52e59c73
commit 75c61f91f1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ std::size_t hash(const BasicJsonType& j, const std::size_t depth = 0)
template<typename BasicJsonType>
struct hash_frame
{
hash_frame(const BasicJsonType* value_, std::size_t seed_)
hash_frame(const BasicJsonType* value_, std::size_t seed_) noexcept
: value(value_), position(value_->cbegin()), seed(seed_)
{}
+1 -1
View File
@@ -7136,7 +7136,7 @@ std::size_t hash(const BasicJsonType& j, const std::size_t depth = 0)
template<typename BasicJsonType>
struct hash_frame
{
hash_frame(const BasicJsonType* value_, std::size_t seed_)
hash_frame(const BasicJsonType* value_, std::size_t seed_) noexcept
: value(value_), position(value_->cbegin()), seed(seed_)
{}