mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
use constexpr value instead of call constexpr func directory
This commit is contained in:
@@ -592,21 +592,21 @@ template<typename T, typename std::enable_if<
|
|||||||
value_traits<T>::is_toml_type, std::nullptr_t>::type>
|
value_traits<T>::is_toml_type, std::nullptr_t>::type>
|
||||||
value::value(T&& v) : type_(toml::detail::check_type<T>())
|
value::value(T&& v) : type_(toml::detail::check_type<T>())
|
||||||
{
|
{
|
||||||
switch_assign<toml::detail::check_type<T>()>::invoke(
|
constexpr value_t kind = toml::detail::check_type<T>();
|
||||||
*this, std::forward<T>(v));
|
switch_assign<kind>::invoke(*this, std::forward<T>(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, typename std::enable_if<
|
template<typename T, typename std::enable_if<
|
||||||
value_traits<T>::is_toml_type, std::nullptr_t>::type>
|
value_traits<T>::is_toml_type, std::nullptr_t>::type>
|
||||||
value& value::operator=(T&& v)
|
value& value::operator=(T&& v)
|
||||||
{
|
{
|
||||||
|
constexpr value_t kind = toml::detail::check_type<T>();
|
||||||
if(should_be_cleaned(this->type_))
|
if(should_be_cleaned(this->type_))
|
||||||
{
|
{
|
||||||
switch_clean(this->type_);
|
switch_clean(this->type_);
|
||||||
}
|
}
|
||||||
this->type_ = toml::detail::check_type<T>();
|
this->type_ = kind;
|
||||||
switch_assign<toml::detail::check_type<T>()>::invoke(
|
switch_assign<kind>::invoke(*this, std::forward<T>(v));
|
||||||
*this, std::forward<T>(v));
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user