1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

Fix ordered_map ctor with initializer_list (#3370)

One of the ordered_map constructors was incorrectly accepting a
std::initializer_list<T> instead of std::initializer_list<value_type>.

Add regression test.

Fixes #3343.
This commit is contained in:
Florian Albrechtskirchinger
2022-03-07 13:41:35 +01:00
committed by GitHub
parent c6d8892e5d
commit 0fd95d2e28
3 changed files with 14 additions and 2 deletions

View File

@ -17070,7 +17070,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
template <class It>
ordered_map(It first, It last, const Allocator& alloc = Allocator())
: Container{first, last, alloc} {}
ordered_map(std::initializer_list<T> init, const Allocator& alloc = Allocator() )
ordered_map(std::initializer_list<value_type> init, const Allocator& alloc = Allocator() )
: Container{init, alloc} {}
std::pair<iterator, bool> emplace(const key_type& key, T&& t)