mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +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>
|
template<typename TC>
|
||||||
void change_region_of_value(basic_value<TC>&, const basic_value<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>
|
template<typename TC, value_t V>
|
||||||
struct getter;
|
struct getter;
|
||||||
} // detail
|
} // detail
|
||||||
@@ -1847,6 +1850,9 @@ class basic_value
|
|||||||
template<typename TC>
|
template<typename TC>
|
||||||
friend void detail::change_region_of_value(basic_value<TC>&, const basic_value<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>
|
template<typename TC>
|
||||||
friend class basic_value;
|
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_);
|
dst.key_region_ = std::move(src.key_region_);
|
||||||
return;
|
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 detail
|
||||||
} // namespace toml
|
} // namespace toml
|
||||||
|
Reference in New Issue
Block a user