diff --git a/include/nlohmann/json_fwd.hpp b/include/nlohmann/json_fwd.hpp index d9e5428d..332227c1 100644 --- a/include/nlohmann/json_fwd.hpp +++ b/include/nlohmann/json_fwd.hpp @@ -61,7 +61,7 @@ uses the standard template types. */ using json = basic_json<>; -template +template struct ordered_map; /*! diff --git a/include/nlohmann/ordered_map.hpp b/include/nlohmann/ordered_map.hpp index 4a71951d..29c52016 100644 --- a/include/nlohmann/ordered_map.hpp +++ b/include/nlohmann/ordered_map.hpp @@ -22,11 +22,13 @@ struct ordered_map : std::vector, Allocator> using typename Container::value_type; // Explicit constructors instead of `using Container::Container` - // otherwise older compilers like GCC 5.5 choke on it + // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {} template ordered_map(It first, It last, const Allocator& alloc = Allocator()) : Container{first, last, alloc} {} + ordered_map(std::initializer_list init, const Allocator& alloc = Allocator() ) + : Container{init, alloc} {} std::pair emplace(key_type&& key, T&& t) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e5e3bc3e..850ee6ab 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -15891,11 +15891,13 @@ struct ordered_map : std::vector, Allocator> using typename Container::value_type; // Explicit constructors instead of `using Container::Container` - // otherwise older compilers like GCC 5.5 choke on it + // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {} template ordered_map(It first, It last, const Allocator& alloc = Allocator()) : Container{first, last, alloc} {} + ordered_map(std::initializer_list init, const Allocator& alloc = Allocator() ) + : Container{init, alloc} {} std::pair emplace(key_type&& key, T&& t) {