Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 26, 2023
1 parent c63feb2 commit c3a6940
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
20 changes: 9 additions & 11 deletions include/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ class basic_array

explicit basic_array(const basic_value<string_t>& val);
explicit basic_array(basic_value<string_t>&& val);
template <typename array_t, typename _ = std::enable_if_t<
std::is_constructible_v<value_type, typename std::decay_t<array_t>::value_type>>>

template <typename array_t, typename _ = std::enable_if_t<std::is_constructible_v<
value_type, decltype(std::declval<array_t>().begin().operator*())>>>
basic_array(array_t arr) : _array_data(std::make_move_iterator(arr.begin()), std::make_move_iterator(arr.end()))
{}

Expand Down Expand Up @@ -380,12 +381,10 @@ class basic_object
basic_object(std::initializer_list<value_type> init_list);
explicit basic_object(const basic_value<string_t>& val);
explicit basic_object(basic_value<string_t>&& val);
template <typename map_t, typename _ = std::enable_if_t<
std::is_constructible_v<value_type, typename std::decay_t<map_t>::value_type>>>
basic_object(map_t map)
{
_object_data.insert(std::make_move_iterator(map.begin()), std::make_move_iterator(map.end()));
}
template <typename map_t, typename _ = std::enable_if_t<std::is_constructible_v<
value_type, decltype(std::declval<map_t>().begin().operator*())>>>
basic_object(map_t map) : _object_data(std::make_move_iterator(map.begin()), std::make_move_iterator(map.end()))
{}

~basic_object() = default;

Expand Down Expand Up @@ -1665,10 +1664,9 @@ 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<value_type> init_list)
: _object_data(std::make_move_iterator(init_list.begin()), std::make_move_iterator(init_list.end()))
{
for (const auto& [key, val] : init_list) {
emplace(key, val);
}
;
}

template <typename string_t>
Expand Down
3 changes: 2 additions & 1 deletion sample/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ int main()

json::value jdata = data;

std::filesystem::path p;
std::filesystem::path p = "i am path/123/456";
auto s = json::serialize<true>(p);
std::cout << s << std::endl;

std::cout << "\n****** Parsing ******\n" << std::endl;

Expand Down

0 comments on commit c3a6940

Please sign in to comment.