mirror of
https://github.com/nlohmann/json.git
synced 2026-09-29 03:00:31 +00:00
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:
@@ -161,7 +161,7 @@ std::size_t hash(const BasicJsonType& j, const std::size_t depth = 0)
|
|||||||
template<typename BasicJsonType>
|
template<typename BasicJsonType>
|
||||||
struct hash_frame
|
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_)
|
: value(value_), position(value_->cbegin()), seed(seed_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@@ -7180,7 +7180,7 @@ std::size_t hash(const BasicJsonType& j, const std::size_t depth = 0)
|
|||||||
template<typename BasicJsonType>
|
template<typename BasicJsonType>
|
||||||
struct hash_frame
|
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_)
|
: value(value_), position(value_->cbegin()), seed(seed_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user