diff --git a/include/toml++/impl/parser_impl.h b/include/toml++/impl/parser_impl.h index 64a5ab52..63ad3a5a 100644 --- a/include/toml++/impl/parser_impl.h +++ b/include/toml++/impl/parser_impl.h @@ -2474,7 +2474,8 @@ TOML_IMPL_NAMESPACE_START // get the value if (is_value_terminator(*cp)) set_error_and_return_default("expected value, saw '"sv, to_sv(*cp), "'"sv); - return { std::move(key), node_ptr{ parse_value() } }; + auto value = parse_value(); + return { std::move(key), node_ptr{ value } }; } TOML_NODISCARD diff --git a/toml.hpp b/toml.hpp index e51ce50d..d9ea1462 100644 --- a/toml.hpp +++ b/toml.hpp @@ -11889,7 +11889,8 @@ TOML_IMPL_NAMESPACE_START // get the value if (is_value_terminator(*cp)) set_error_and_return_default("expected value, saw '"sv, to_sv(*cp), "'"sv); - return { std::move(key), node_ptr{ parse_value() } }; + auto value = parse_value(); + return { std::move(key), node_ptr{ value } }; } TOML_NODISCARD