Skip to content

Commit

Permalink
fix: initializer_list arg type
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 26, 2023
1 parent 7bf89a2 commit ce58dfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class basic_value

basic_value(basic_array<string_t> arr);
basic_value(basic_object<string_t> obj);
basic_value(std::initializer_list<std::pair<string_t, basic_value<string_t>>> init_list);
basic_value(std::initializer_list<typename basic_object<string_t>::value_type> init_list);

// Constructed from raw data
template <typename... args_t>
Expand Down Expand Up @@ -263,7 +263,7 @@ class basic_array
basic_array(basic_array<string_t>&& rhs) noexcept = default;
basic_array(const raw_array& arr);
basic_array(raw_array&& arr) noexcept;
basic_array(std::initializer_list<typename raw_array::value_type> init_list);
basic_array(std::initializer_list<value_type> init_list);
basic_array(typename raw_array::size_type size);

explicit basic_array(const basic_value<string_t>& val);
Expand Down Expand Up @@ -712,7 +712,7 @@ MEOJSON_INLINE basic_value<string_t>::basic_value(basic_object<string_t> obj)

template <typename string_t>
MEOJSON_INLINE basic_value<string_t>::basic_value(
std::initializer_list<std::pair<string_t, basic_value<string_t>>> init_list)
std::initializer_list<typename basic_object<string_t>::value_type> init_list)
: _type(value_type::object), _raw_data(std::make_unique<basic_object<string_t>>(init_list))
{
;
Expand Down Expand Up @@ -1666,7 +1666,7 @@ MEOJSON_INLINE basic_object<string_t>::basic_object(raw_object&& raw_obj) : _obj
}

template <typename string_t>
MEOJSON_INLINE basic_object<string_t>::basic_object(std::initializer_list<typename raw_object::value_type> init_list)
MEOJSON_INLINE basic_object<string_t>::basic_object(std::initializer_list<value_type> init_list)
{
for (const auto& [key, val] : init_list) {
emplace(key, val);
Expand Down

0 comments on commit ce58dfd

Please sign in to comment.