mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-25 22:00:05 +00:00
refactor: rm template from detail::change_region
This commit is contained in:
parent
bc219af5b5
commit
22ace027de
@ -27,16 +27,10 @@ inline region_base const* get_region(const Value& v)
|
|||||||
return v.region_info_.get();
|
return v.region_info_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Value, typename Region>
|
template<typename Value>
|
||||||
void change_region(Value& v, Region&& reg)
|
void change_region(Value& v, region reg)
|
||||||
{
|
{
|
||||||
using region_type = typename std::remove_reference<
|
v.region_info_ = std::make_shared<region>(std::move(reg));
|
||||||
typename std::remove_cv<Region>::type
|
|
||||||
>::type;
|
|
||||||
|
|
||||||
std::shared_ptr<region_base> new_reg =
|
|
||||||
std::make_shared<region_type>(std::forward<region_type>(reg));
|
|
||||||
v.region_info_ = new_reg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1709,8 +1703,8 @@ class basic_value
|
|||||||
template<typename Value>
|
template<typename Value>
|
||||||
friend region_base const* detail::get_region(const Value& v);
|
friend region_base const* detail::get_region(const Value& v);
|
||||||
|
|
||||||
template<typename Value, typename Region>
|
template<typename Value>
|
||||||
friend void detail::change_region(Value& v, Region&& reg);
|
friend void detail::change_region(Value& v, region reg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user