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-24 17:11:38 +02:00
committed by GitHub
parent 9be5018748
commit 00bfe6808b
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
@@ -7180,7 +7180,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_)
{}