Skip to content

Commit 226aa59

Browse files
committed
Support initializing map using a pair initializer list
1 parent 266b815 commit 226aa59

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/map

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <utility>
2323
#include <iterator>
2424
#include <associative_base>
25+
#include <initializer_list>
2526

2627

2728
#ifndef __STD_HEADER_MAP
@@ -109,6 +110,10 @@ public:
109110
const Compare& comp = Compare(), const Allocator& al = Allocator())
110111
: base(first, last, comp, al, v_t_k) { }
111112

113+
map(initializer_list<pair<Key, T>> in, const Compare& comp = Compare(),
114+
const Allocator& al = Allocator())
115+
: base(in.begin(), in.end(), comp, al, v_t_k) { }
116+
112117
map(const map<Key,T,Compare,Allocator>& x) : base(x) { }
113118
~map() { }
114119

0 commit comments

Comments
 (0)