mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-19 03:18:09 +08:00
feat(WIP): use default arg instead of overloads
This commit is contained in:
@@ -355,25 +355,15 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (boolean) ============================================== {{{
|
// constructor (boolean) ============================================== {{{
|
||||||
|
|
||||||
basic_value(boolean_type x)
|
|
||||||
: basic_value(x, boolean_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(boolean_type x, boolean_format_info fmt)
|
|
||||||
: basic_value(x, fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(boolean_type x, std::vector<std::string> com)
|
basic_value(boolean_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, boolean_format_info{}, std::move(com), region_type{},
|
: basic_value(x, boolean_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(boolean_type x, boolean_format_info fmt, std::vector<std::string> com)
|
basic_value(boolean_type x,
|
||||||
: basic_value(x, fmt, std::move(com), region_type{},
|
boolean_format_info fmt = boolean_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(boolean_type x, boolean_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::boolean), boolean_(boolean_storage(x, fmt)),
|
: type_(value_t::boolean), boolean_(boolean_storage(x, fmt)),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(key_reg), key_fmt_(key_fmt)
|
key_region_(key_reg), key_fmt_(key_fmt)
|
||||||
@@ -397,25 +387,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (integer) ============================================== {{{
|
// constructor (integer) ============================================== {{{
|
||||||
|
|
||||||
basic_value(integer_type x)
|
|
||||||
: basic_value(std::move(x), integer_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(integer_type x, integer_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(integer_type x, std::vector<std::string> com)
|
basic_value(integer_type x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), integer_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), integer_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(integer_type x, integer_format_info fmt, std::vector<std::string> com)
|
basic_value(integer_type x,
|
||||||
: basic_value(std::move(x), std::move(fmt), std::move(com), region_type{},
|
integer_format_info fmt = integer_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(integer_type x, integer_format_info fmt, std::vector<std::string> com, region_type reg,
|
region_type reg = region_type{},
|
||||||
region_type key_reg, key_format_info key_fmt)
|
region_type key_reg = region_type{})
|
||||||
: type_(value_t::integer), integer_(integer_storage(std::move(x), std::move(fmt))),
|
: type_(value_t::integer),
|
||||||
|
integer_(integer_storage(std::move(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -445,30 +427,19 @@ class basic_value
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
|
||||||
basic_value(T x)
|
|
||||||
: basic_value(std::move(x), integer_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
|
||||||
basic_value(T x, integer_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
||||||
basic_value(T x, std::vector<std::string> com)
|
basic_value(T x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), integer_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), integer_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
||||||
basic_value(T x, integer_format_info fmt, std::vector<std::string> com)
|
basic_value(T x,
|
||||||
: basic_value(std::move(x), std::move(fmt), std::move(com), region_type{},
|
integer_format_info fmt = integer_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
template<typename T, enable_if_integer_like_t<T> = nullptr>
|
region_type reg = region_type{},
|
||||||
basic_value(T x, integer_format_info fmt, std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::integer),
|
||||||
: type_(value_t::integer), integer_(integer_storage(std::move(x), std::move(fmt))),
|
integer_(integer_storage(std::move(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -492,25 +463,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (floating) ============================================= {{{
|
// constructor (floating) ============================================= {{{
|
||||||
|
|
||||||
basic_value(floating_type x)
|
|
||||||
: basic_value(std::move(x), floating_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(floating_type x, floating_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(floating_type x, std::vector<std::string> com)
|
basic_value(floating_type x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), floating_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), floating_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(floating_type x, floating_format_info fmt, std::vector<std::string> com)
|
basic_value(floating_type x,
|
||||||
: basic_value(std::move(x), std::move(fmt), std::move(com), region_type{},
|
floating_format_info fmt = floating_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(floating_type x, floating_format_info fmt, std::vector<std::string> com, region_type reg,
|
region_type reg = region_type{},
|
||||||
region_type key_reg, key_format_info key_fmt)
|
region_type key_reg = region_type{})
|
||||||
: type_(value_t::floating), floating_(floating_storage(std::move(x), std::move(fmt))),
|
: type_(value_t::floating),
|
||||||
|
floating_(floating_storage(std::move(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -539,38 +502,22 @@ class basic_value
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
|
||||||
basic_value(T x)
|
|
||||||
: basic_value(x, floating_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
|
||||||
basic_value(T x, floating_format_info fmt)
|
|
||||||
: basic_value(x, std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
||||||
basic_value(T x, std::vector<std::string> com)
|
basic_value(T x, std::vector<std::string> com)
|
||||||
: basic_value(x, floating_format_info{}, std::move(com), region_type{},
|
: basic_value(x, floating_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
||||||
basic_value(T x, floating_format_info fmt, std::vector<std::string> com)
|
basic_value(T x,
|
||||||
: basic_value(x, std::move(fmt), std::move(com), region_type{},
|
floating_format_info fmt = floating_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
|
region_type reg = region_type{},
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
region_type key_reg = region_type{})
|
||||||
basic_value(T x, floating_format_info fmt, std::vector<std::string> com, region_type reg,
|
: type_(value_t::floating),
|
||||||
region_type key_reg, key_format_info key_fmt)
|
floating_(floating_storage(x, std::move(fmt))),
|
||||||
: type_(value_t::floating), floating_(floating_storage(x, std::move(fmt))),
|
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
template<typename T, enable_if_floating_like_t<T> = nullptr>
|
||||||
basic_value& operator=(T x)
|
basic_value& operator=(T x)
|
||||||
{
|
{
|
||||||
@@ -591,26 +538,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (string) =============================================== {{{
|
// constructor (string) =============================================== {{{
|
||||||
|
|
||||||
basic_value(string_type x)
|
|
||||||
: basic_value(std::move(x), string_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(string_type x, string_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(string_type x, std::vector<std::string> com)
|
basic_value(string_type x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), string_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), string_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(string_type x, string_format_info fmt, std::vector<std::string> com)
|
basic_value(string_type x,
|
||||||
: basic_value(std::move(x), std::move(fmt), std::move(com), region_type{},
|
string_format_info fmt = string_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(string_type x, string_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::string),
|
||||||
: type_(value_t::string), string_(string_storage(std::move(x), std::move(fmt))),
|
string_(string_storage(std::move(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -631,26 +569,17 @@ class basic_value
|
|||||||
|
|
||||||
// "string literal"
|
// "string literal"
|
||||||
|
|
||||||
basic_value(const typename string_type::value_type* x)
|
|
||||||
: basic_value(x, string_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(const typename string_type::value_type* x, string_format_info fmt)
|
|
||||||
: basic_value(x, std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(const typename string_type::value_type* x, std::vector<std::string> com)
|
basic_value(const typename string_type::value_type* x, std::vector<std::string> com)
|
||||||
: basic_value(x, string_format_info{}, std::move(com), region_type{},
|
: basic_value(x, string_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(const typename string_type::value_type* x, string_format_info fmt, std::vector<std::string> com)
|
basic_value(const typename string_type::value_type* x,
|
||||||
: basic_value(x, std::move(fmt), std::move(com), region_type{},
|
string_format_info fmt = string_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(const typename string_type::value_type* x, string_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::string),
|
||||||
: type_(value_t::string), string_(string_storage(string_type(x), std::move(fmt))),
|
string_(string_storage(string_type(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -673,25 +602,15 @@ class basic_value
|
|||||||
using string_view_type = std::basic_string_view<
|
using string_view_type = std::basic_string_view<
|
||||||
typename string_type::value_type, typename string_type::traits_type>;
|
typename string_type::value_type, typename string_type::traits_type>;
|
||||||
|
|
||||||
basic_value(string_view_type x)
|
|
||||||
: basic_value(x, string_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(string_view_type x, string_format_info fmt)
|
|
||||||
: basic_value(x, std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(string_view_type x, std::vector<std::string> com)
|
basic_value(string_view_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, string_format_info{}, std::move(com), region_type{},
|
: basic_value(x, string_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(string_view_type x, string_format_info fmt, std::vector<std::string> com)
|
basic_value(string_view_type x,
|
||||||
: basic_value(x, std::move(fmt), std::move(com), region_type{},
|
string_format_info fmt = string_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(string_view_type x, string_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::string), string_(string_storage(string_type(x), std::move(fmt))),
|
: type_(value_t::string), string_(string_storage(string_type(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
@@ -713,45 +632,23 @@ class basic_value
|
|||||||
|
|
||||||
#endif // TOML11_HAS_STRING_VIEW
|
#endif // TOML11_HAS_STRING_VIEW
|
||||||
|
|
||||||
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
|
||||||
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
|
||||||
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{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
|
||||||
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
|
||||||
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{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
||||||
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
||||||
detail::is_1byte_std_basic_string<T>
|
detail::is_1byte_std_basic_string<T>
|
||||||
>::value, std::nullptr_t> = nullptr>
|
>::value, std::nullptr_t> = nullptr>
|
||||||
basic_value(const T& x, std::vector<std::string> com)
|
basic_value(const T& x, std::vector<std::string> com)
|
||||||
: basic_value(x, string_format_info{}, std::move(com), region_type{},
|
: basic_value(x, string_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
||||||
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
||||||
detail::is_1byte_std_basic_string<T>
|
detail::is_1byte_std_basic_string<T>
|
||||||
>::value, std::nullptr_t> = nullptr>
|
>::value, std::nullptr_t> = nullptr>
|
||||||
basic_value(const T& x, string_format_info fmt, std::vector<std::string> com)
|
basic_value(const T& x,
|
||||||
: basic_value(x, std::move(fmt), std::move(com), region_type{},
|
string_format_info fmt = string_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
template<typename T, cxx::enable_if_t<cxx::conjunction<
|
region_type reg = region_type{},
|
||||||
cxx::negation<std::is_same<cxx::remove_cvref_t<T>, string_type>>,
|
region_type key_reg = region_type{})
|
||||||
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,
|
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::string),
|
: type_(value_t::string),
|
||||||
string_(string_storage(detail::string_conv<string_type>(x), std::move(fmt))),
|
string_(string_storage(detail::string_conv<string_type>(x), std::move(fmt))),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
@@ -780,26 +677,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (local_date) =========================================== {{{
|
// constructor (local_date) =========================================== {{{
|
||||||
|
|
||||||
basic_value(local_date_type x)
|
|
||||||
: basic_value(x, local_date_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_date_type x, local_date_format_info fmt)
|
|
||||||
: basic_value(x, fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_date_type x, std::vector<std::string> com)
|
basic_value(local_date_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, local_date_format_info{}, std::move(com), region_type{},
|
: basic_value(x, local_date_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(local_date_type x, local_date_format_info fmt, std::vector<std::string> com)
|
basic_value(local_date_type x,
|
||||||
: basic_value(x, fmt, std::move(com), region_type{},
|
local_date_format_info fmt = local_date_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(local_date_type x, local_date_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::local_date),
|
||||||
: type_(value_t::local_date), local_date_(local_date_storage(x, fmt)),
|
local_date_(local_date_storage(x, fmt)),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -822,25 +710,15 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (local_time) =========================================== {{{
|
// constructor (local_time) =========================================== {{{
|
||||||
|
|
||||||
basic_value(local_time_type x)
|
|
||||||
: basic_value(x, local_time_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_time_type x, local_time_format_info fmt)
|
|
||||||
: basic_value(x, fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_time_type x, std::vector<std::string> com)
|
basic_value(local_time_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, local_time_format_info{}, std::move(com), region_type{},
|
: basic_value(x, local_time_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(local_time_type x, local_time_format_info fmt, std::vector<std::string> com)
|
basic_value(local_time_type x,
|
||||||
: basic_value(x, fmt, std::move(com), region_type{},
|
local_time_format_info fmt = local_time_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(local_time_type x, local_time_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::local_time), local_time_(local_time_storage(x, fmt)),
|
: type_(value_t::local_time), local_time_(local_time_storage(x, fmt)),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
@@ -860,31 +738,17 @@ class basic_value
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Rep, typename Period>
|
|
||||||
basic_value(const std::chrono::duration<Rep, Period>& x)
|
|
||||||
: basic_value(local_time_type(x), local_time_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename Rep, typename Period>
|
|
||||||
basic_value(const std::chrono::duration<Rep, Period>& x, local_time_format_info fmt)
|
|
||||||
: basic_value(local_time_type(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename Rep, typename Period>
|
template<typename Rep, typename Period>
|
||||||
basic_value(const std::chrono::duration<Rep, Period>& x, std::vector<std::string> com)
|
basic_value(const std::chrono::duration<Rep, Period>& x, std::vector<std::string> com)
|
||||||
: basic_value(local_time_type(x), local_time_format_info{}, std::move(com), region_type{},
|
: basic_value(local_time_type(x), local_time_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename Rep, typename Period>
|
|
||||||
basic_value(const std::chrono::duration<Rep, Period>& x, local_time_format_info fmt, std::vector<std::string> com)
|
|
||||||
: basic_value(local_time_type(x), std::move(fmt), std::move(com), region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
template<typename Rep, typename Period>
|
template<typename Rep, typename Period>
|
||||||
basic_value(const std::chrono::duration<Rep, Period>& x,
|
basic_value(const std::chrono::duration<Rep, Period>& x,
|
||||||
local_time_format_info fmt,
|
local_time_format_info fmt = local_time_format_info{},
|
||||||
std::vector<std::string> com, region_type reg,
|
std::vector<std::string> com = {},
|
||||||
region_type key_reg, key_format_info key_fmt)
|
key_format_info key_fmt = key_format_info{},
|
||||||
|
region_type reg = region_type{},
|
||||||
|
region_type key_reg = region_type{})
|
||||||
: basic_value(local_time_type(x), std::move(fmt), std::move(com), std::move(reg),
|
: basic_value(local_time_type(x), std::move(fmt), std::move(com), std::move(reg),
|
||||||
std::move(key_reg), std::move(key_fmt))
|
std::move(key_reg), std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -908,26 +772,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (local_datetime) =========================================== {{{
|
// constructor (local_datetime) =========================================== {{{
|
||||||
|
|
||||||
basic_value(local_datetime_type x)
|
|
||||||
: basic_value(x, local_datetime_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_datetime_type x, local_datetime_format_info fmt)
|
|
||||||
: basic_value(x, fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(local_datetime_type x, std::vector<std::string> com)
|
basic_value(local_datetime_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, local_datetime_format_info{}, std::move(com), region_type{},
|
: basic_value(x, local_datetime_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(local_datetime_type x, local_datetime_format_info fmt, std::vector<std::string> com)
|
basic_value(local_datetime_type x,
|
||||||
: basic_value(x, fmt, std::move(com), region_type{},
|
local_datetime_format_info fmt = local_datetime_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(local_datetime_type x, local_datetime_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::local_datetime),
|
||||||
: type_(value_t::local_datetime), local_datetime_(local_datetime_storage(x, fmt)),
|
local_datetime_(local_datetime_storage(x, fmt)),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -950,26 +805,17 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (offset_datetime) =========================================== {{{
|
// constructor (offset_datetime) =========================================== {{{
|
||||||
|
|
||||||
basic_value(offset_datetime_type x)
|
|
||||||
: basic_value(x, offset_datetime_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(offset_datetime_type x, offset_datetime_format_info fmt)
|
|
||||||
: basic_value(x, fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(offset_datetime_type x, std::vector<std::string> com)
|
basic_value(offset_datetime_type x, std::vector<std::string> com)
|
||||||
: basic_value(x, offset_datetime_format_info{}, std::move(com), region_type{},
|
: basic_value(x, offset_datetime_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(offset_datetime_type x, offset_datetime_format_info fmt, std::vector<std::string> com)
|
basic_value(offset_datetime_type x,
|
||||||
: basic_value(x, fmt, std::move(com), region_type{},
|
offset_datetime_format_info fmt = offset_datetime_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(offset_datetime_type x, offset_datetime_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: type_(value_t::offset_datetime),
|
||||||
: type_(value_t::offset_datetime), offset_datetime_(offset_datetime_storage(x, fmt)),
|
offset_datetime_(offset_datetime_storage(x, fmt)),
|
||||||
region_(std::move(reg)), comments_(std::move(com)),
|
region_(std::move(reg)), comments_(std::move(com)),
|
||||||
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
key_region_(std::move(key_reg)), key_fmt_(std::move(key_fmt))
|
||||||
{}
|
{}
|
||||||
@@ -990,27 +836,17 @@ class basic_value
|
|||||||
|
|
||||||
// system_clock::time_point
|
// system_clock::time_point
|
||||||
|
|
||||||
basic_value(std::chrono::system_clock::time_point x)
|
|
||||||
: basic_value(offset_datetime_type(x), offset_datetime_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(std::chrono::system_clock::time_point x, offset_datetime_format_info fmt)
|
|
||||||
: basic_value(offset_datetime_type(x), fmt, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(std::chrono::system_clock::time_point x, std::vector<std::string> com)
|
basic_value(std::chrono::system_clock::time_point x, std::vector<std::string> com)
|
||||||
: basic_value(offset_datetime_type(x), offset_datetime_format_info{}, std::move(com), region_type{},
|
: basic_value(offset_datetime_type(x), offset_datetime_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(std::chrono::system_clock::time_point x, offset_datetime_format_info fmt, std::vector<std::string> com)
|
basic_value(std::chrono::system_clock::time_point x,
|
||||||
: basic_value(offset_datetime_type(x), fmt, std::move(com), region_type{},
|
offset_datetime_format_info fmt = offset_datetime_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(std::chrono::system_clock::time_point x, offset_datetime_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
: basic_value(offset_datetime_type(x), std::move(fmt), std::move(com),
|
||||||
: basic_value(offset_datetime_type(x), std::move(fmt), std::move(com), std::move(reg),
|
std::move(key_fmt), std::move(reg), std::move(key_reg))
|
||||||
std::move(key_reg), std::move(key_fmt))
|
|
||||||
{}
|
{}
|
||||||
basic_value& operator=(std::chrono::system_clock::time_point x)
|
basic_value& operator=(std::chrono::system_clock::time_point x)
|
||||||
{
|
{
|
||||||
@@ -1031,25 +867,15 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (array) ================================================ {{{
|
// constructor (array) ================================================ {{{
|
||||||
|
|
||||||
basic_value(array_type x)
|
|
||||||
: basic_value(std::move(x), array_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(array_type x, array_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(array_type x, std::vector<std::string> com)
|
basic_value(array_type x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), array_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), array_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(array_type x, array_format_info fmt, std::vector<std::string> com)
|
basic_value(array_type x,
|
||||||
: basic_value(std::move(x), fmt, std::move(com), region_type{},
|
array_format_info fmt = array_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(array_type x, array_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::array), array_(array_storage(
|
: type_(value_t::array), array_(array_storage(
|
||||||
detail::storage<array_type>(std::move(x)), std::move(fmt)
|
detail::storage<array_type>(std::move(x)), std::move(fmt)
|
||||||
)), region_(std::move(reg)), comments_(std::move(com)),
|
)), region_(std::move(reg)), comments_(std::move(com)),
|
||||||
@@ -1087,30 +913,17 @@ class basic_value
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename T, enable_if_array_like_t<T> = nullptr>
|
|
||||||
basic_value(T x)
|
|
||||||
: basic_value(std::move(x), array_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_array_like_t<T> = nullptr>
|
|
||||||
basic_value(T x, array_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_array_like_t<T> = nullptr>
|
template<typename T, enable_if_array_like_t<T> = nullptr>
|
||||||
basic_value(T x, std::vector<std::string> com)
|
basic_value(T x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), array_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), array_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
template<typename T, enable_if_array_like_t<T> = nullptr>
|
template<typename T, enable_if_array_like_t<T> = nullptr>
|
||||||
basic_value(T x, array_format_info fmt, std::vector<std::string> com)
|
basic_value(T x,
|
||||||
: basic_value(std::move(x), fmt, std::move(com), region_type{},
|
array_format_info fmt = array_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
template<typename T, enable_if_array_like_t<T> = nullptr>
|
region_type reg = region_type{},
|
||||||
basic_value(T x, array_format_info fmt,
|
region_type key_reg = region_type{})
|
||||||
std::vector<std::string> com, region_type reg,
|
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::array), array_(array_storage(
|
: type_(value_t::array), array_(array_storage(
|
||||||
detail::storage<array_type>(array_type(
|
detail::storage<array_type>(array_type(
|
||||||
std::make_move_iterator(x.begin()),
|
std::make_move_iterator(x.begin()),
|
||||||
@@ -1143,25 +956,15 @@ class basic_value
|
|||||||
|
|
||||||
// constructor (table) ================================================ {{{
|
// constructor (table) ================================================ {{{
|
||||||
|
|
||||||
basic_value(table_type x)
|
|
||||||
: basic_value(std::move(x), table_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(table_type x, table_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
basic_value(table_type x, std::vector<std::string> com)
|
basic_value(table_type x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), table_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), table_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
basic_value(table_type x, table_format_info fmt, std::vector<std::string> com)
|
basic_value(table_type x,
|
||||||
: basic_value(std::move(x), fmt, std::move(com), region_type{},
|
table_format_info fmt = table_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
basic_value(table_type x, table_format_info fmt,
|
region_type reg = region_type{},
|
||||||
std::vector<std::string> com, region_type reg,
|
region_type key_reg = region_type{})
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::table), table_(table_storage(
|
: type_(value_t::table), table_(table_storage(
|
||||||
detail::storage<table_type>(std::move(x)), std::move(fmt)
|
detail::storage<table_type>(std::move(x)), std::move(fmt)
|
||||||
)), region_(std::move(reg)), comments_(std::move(com)),
|
)), region_(std::move(reg)), comments_(std::move(com)),
|
||||||
@@ -1197,30 +1000,17 @@ class basic_value
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<typename T, enable_if_table_like_t<T> = nullptr>
|
|
||||||
basic_value(T x)
|
|
||||||
: basic_value(std::move(x), table_format_info{}, std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_table_like_t<T> = nullptr>
|
|
||||||
basic_value(T x, table_format_info fmt)
|
|
||||||
: basic_value(std::move(x), std::move(fmt), std::vector<std::string>{}, region_type{},
|
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
|
||||||
template<typename T, enable_if_table_like_t<T> = nullptr>
|
template<typename T, enable_if_table_like_t<T> = nullptr>
|
||||||
basic_value(T x, std::vector<std::string> com)
|
basic_value(T x, std::vector<std::string> com)
|
||||||
: basic_value(std::move(x), table_format_info{}, std::move(com), region_type{},
|
: basic_value(std::move(x), table_format_info{}, std::move(com))
|
||||||
region_type{}, key_format_info{})
|
|
||||||
{}
|
{}
|
||||||
template<typename T, enable_if_table_like_t<T> = nullptr>
|
template<typename T, enable_if_table_like_t<T> = nullptr>
|
||||||
basic_value(T x, table_format_info fmt, std::vector<std::string> com)
|
basic_value(T x,
|
||||||
: basic_value(std::move(x), fmt, std::move(com), region_type{},
|
table_format_info fmt = table_format_info{},
|
||||||
region_type{}, key_format_info{})
|
std::vector<std::string> com = {},
|
||||||
{}
|
key_format_info key_fmt = key_format_info{},
|
||||||
template<typename T, enable_if_table_like_t<T> = nullptr>
|
region_type reg = region_type{},
|
||||||
basic_value(T x, table_format_info fmt,
|
region_type key_reg = region_type{})
|
||||||
std::vector<std::string> com, region_type reg,
|
|
||||||
region_type key_reg, key_format_info key_fmt)
|
|
||||||
: type_(value_t::table), table_(table_storage(
|
: type_(value_t::table), table_(table_storage(
|
||||||
detail::storage<table_type>(table_type(
|
detail::storage<table_type>(table_type(
|
||||||
std::make_move_iterator(x.begin()),
|
std::make_move_iterator(x.begin()),
|
||||||
|
Reference in New Issue
Block a user