Skip to content

Commit

Permalink
feat: generalize ctor and remove feature macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Jul 16, 2024
1 parent b68f1fd commit 00e0ce1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions include/toml11/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,38 +645,37 @@ class basic_value

#endif // TOML11_HAS_STRING_VIEW

#if defined(TOML11_HAS_CHAR8_T)
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value(const T& x)
: basic_value(x, string_format_info{}, std::vector<std::string>{}, region_type{})
{}
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value(const T& x, string_format_info fmt)
: basic_value(x, std::move(fmt), std::vector<std::string>{}, region_type{})
{}
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value(const T& x, std::vector<std::string> com)
: basic_value(x, string_format_info{}, std::move(com), region_type{})
{}
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value(const T& x, string_format_info fmt, std::vector<std::string> com)
: basic_value(x, std::move(fmt), std::move(com), region_type{})
{}
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value(const T& x, string_format_info fmt,
std::vector<std::string> com, region_type reg)
Expand All @@ -686,7 +685,7 @@ class basic_value
{}
template<typename T, cxx::enable_if_t<cxx::conjunction<
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
std::is_same<cxx::remove_cvref_t<T>, std::u8string>
detail::is_1byte_std_basic_string<T>
>::value, std::nullptr_t> = nullptr>
basic_value& operator=(const T& x)
{
Expand All @@ -702,8 +701,6 @@ class basic_value
return *this;
}

#endif // TOML11_HAS_STRING_VIEW

// }}}

// constructor (local_date) =========================================== {{{
Expand Down

0 comments on commit 00e0ce1

Please sign in to comment.