1
0
mirror of https://github.com/nlohmann/json synced 2024-11-25 21:30:06 +00:00

Fix compilation for xcode 9.x

This commit is contained in:
Agustín F. Pozuelo 2020-07-03 01:44:18 +01:00
parent 93770467a1
commit 25f5d75e6e
3 changed files with 7 additions and 3 deletions

View File

@ -61,7 +61,7 @@ uses the standard template types.
*/ */
using json = basic_json<>; using json = basic_json<>;
template<class Key, class T, class IgnoredLess, class Allocator, class Container> template<class Key, class T, class IgnoredLess, class Allocator>
struct ordered_map; struct ordered_map;
/*! /*!

View File

@ -22,11 +22,13 @@ struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
using typename Container::value_type; using typename Container::value_type;
// Explicit constructors instead of `using Container::Container` // 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} {} ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {}
template <class It> template <class It>
ordered_map(It first, It last, const Allocator& alloc = Allocator()) ordered_map(It first, It last, const Allocator& alloc = Allocator())
: Container{first, last, alloc} {} : Container{first, last, alloc} {}
ordered_map(std::initializer_list<T> init, const Allocator& alloc = Allocator() )
: Container{init, alloc} {}
std::pair<iterator, bool> emplace(key_type&& key, T&& t) std::pair<iterator, bool> emplace(key_type&& key, T&& t)
{ {

View File

@ -15891,11 +15891,13 @@ struct ordered_map : std::vector<std::pair<const Key, T>, Allocator>
using typename Container::value_type; using typename Container::value_type;
// Explicit constructors instead of `using Container::Container` // 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} {} ordered_map(const Allocator& alloc = Allocator()) : Container{alloc} {}
template <class It> template <class It>
ordered_map(It first, It last, const Allocator& alloc = Allocator()) ordered_map(It first, It last, const Allocator& alloc = Allocator())
: Container{first, last, alloc} {} : Container{first, last, alloc} {}
ordered_map(std::initializer_list<T> init, const Allocator& alloc = Allocator() )
: Container{init, alloc} {}
std::pair<iterator, bool> emplace(key_type&& key, T&& t) std::pair<iterator, bool> emplace(key_type&& key, T&& t)
{ {