mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +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::value(T&& v) : type_(toml::detail::check_type<T>())
|
||||
{
|
||||
switch_assign<toml::detail::check_type<T>()>::invoke(
|
||||
*this, std::forward<T>(v));
|
||||
constexpr value_t kind = toml::detail::check_type<T>();
|
||||
switch_assign<kind>::invoke(*this, std::forward<T>(v));
|
||||
}
|
||||
|
||||
template<typename T, typename std::enable_if<
|
||||
value_traits<T>::is_toml_type, std::nullptr_t>::type>
|
||||
value& value::operator=(T&& v)
|
||||
{
|
||||
constexpr value_t kind = toml::detail::check_type<T>();
|
||||
if(should_be_cleaned(this->type_))
|
||||
{
|
||||
switch_clean(this->type_);
|
||||
}
|
||||
this->type_ = toml::detail::check_type<T>();
|
||||
switch_assign<toml::detail::check_type<T>()>::invoke(
|
||||
*this, std::forward<T>(v));
|
||||
this->type_ = kind;
|
||||
switch_assign<kind>::invoke(*this, std::forward<T>(v));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user