mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:43:51 +08:00
feat: add detail::change_region_of_key
This commit is contained in:
@@ -53,6 +53,9 @@ error_info make_not_found_error(const basic_value<TC>&, const std::string&, cons
|
||||
template<typename TC>
|
||||
void change_region_of_value(basic_value<TC>&, const basic_value<TC>&);
|
||||
|
||||
template<typename TC>
|
||||
void change_region_of_key(basic_value<TC>&, region);
|
||||
|
||||
template<typename TC, value_t V>
|
||||
struct getter;
|
||||
} // detail
|
||||
@@ -1847,6 +1850,9 @@ class basic_value
|
||||
template<typename TC>
|
||||
friend void detail::change_region_of_value(basic_value<TC>&, const basic_value<TC>&);
|
||||
|
||||
template<typename TC>
|
||||
friend void change_region_of_key(basic_value<TC>&, detail::region);
|
||||
|
||||
template<typename TC>
|
||||
friend class basic_value;
|
||||
|
||||
@@ -2196,6 +2202,12 @@ void change_region_of_value(basic_value<TC>& dst, const basic_value<TC>& src)
|
||||
dst.key_region_ = std::move(src.key_region_);
|
||||
return;
|
||||
}
|
||||
template<typename TC>
|
||||
void change_region_of_key(basic_value<TC>& dst, region src)
|
||||
{
|
||||
dst.key_region_ = std::move(src);
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace toml
|
||||
|
Reference in New Issue
Block a user