From a39300f9d99157f05b8ef85ef267b6a9f906a162 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 27 Jul 2024 16:39:46 +0900 Subject: [PATCH] feat: add detail::change_region_of_key --- include/toml11/value.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/toml11/value.hpp b/include/toml11/value.hpp index 0c6a47c..4ec2b10 100644 --- a/include/toml11/value.hpp +++ b/include/toml11/value.hpp @@ -53,6 +53,9 @@ error_info make_not_found_error(const basic_value&, const std::string&, cons template void change_region_of_value(basic_value&, const basic_value&); +template +void change_region_of_key(basic_value&, region); + template struct getter; } // detail @@ -1847,6 +1850,9 @@ class basic_value template friend void detail::change_region_of_value(basic_value&, const basic_value&); + template + friend void change_region_of_key(basic_value&, detail::region); + template friend class basic_value; @@ -2196,6 +2202,12 @@ void change_region_of_value(basic_value& dst, const basic_value& src) dst.key_region_ = std::move(src.key_region_); return; } +template +void change_region_of_key(basic_value& dst, region src) +{ + dst.key_region_ = std::move(src); + return; +} } // namespace detail } // namespace toml