From 170b0d6b3f3b58788b871a97b94271a0674ae293 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 5 May 2018 12:06:06 +0900 Subject: [PATCH] use constexpr value instead of call constexpr func directory --- toml/value.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toml/value.hpp b/toml/value.hpp index e918393..3240956 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -592,21 +592,21 @@ template::is_toml_type, std::nullptr_t>::type> value::value(T&& v) : type_(toml::detail::check_type()) { - switch_assign()>::invoke( - *this, std::forward(v)); + constexpr value_t kind = toml::detail::check_type(); + switch_assign::invoke(*this, std::forward(v)); } template::is_toml_type, std::nullptr_t>::type> value& value::operator=(T&& v) { + constexpr value_t kind = toml::detail::check_type(); if(should_be_cleaned(this->type_)) { switch_clean(this->type_); } - this->type_ = toml::detail::check_type(); - switch_assign()>::invoke( - *this, std::forward(v)); + this->type_ = kind; + switch_assign::invoke(*this, std::forward(v)); return *this; }