Skip to content

Commit d20a1be

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: Headers: emplace_{front,back} returns a reference from C++17 onwards
2 parents c07b173 + 8193103 commit d20a1be

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

headers/deque

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ public:
186186
void push_back(T&& value);
187187
#endif
188188

189-
#if CPPREFERENCE_STDVER>= 2011
189+
#if CPPREFERENCE_STDVER >= 2017
190+
template<class... Args>
191+
reference emplace_back(Args&& ... args);
192+
#elif CPPREFERENCE_STDVER >= 2011
190193
template<class... Args>
191194
void emplace_back(Args&& ... args);
192195
#endif
@@ -198,7 +201,10 @@ public:
198201
void push_front(T&& value);
199202
#endif
200203

201-
#if CPPREFERENCE_STDVER>= 2011
204+
#if CPPREFERENCE_STDVER >= 2017
205+
template<class... Args>
206+
reference emplace_front(Args&& ... args);
207+
#elif CPPREFERENCE_STDVER >= 2011
202208
template<class... Args>
203209
void emplace_front(Args&& ... args);
204210
#endif

headers/forward_list

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ public:
129129
void push_front(const T& value);
130130
void push_front(T&& value);
131131

132+
#if CPPREFERENCE_STDVER >= 2017
133+
template<class... Args>
134+
reference emplace_front(Args&& ... args);
135+
#else
132136
template<class... Args>
133137
void emplace_front(Args&& ... args);
138+
#endif
134139

135140
void pop_front();
136141

headers/list

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ public:
175175
void push_back(T&& value);
176176
#endif
177177

178-
#if CPPREFERENCE_STDVER>= 2011
178+
#if CPPREFERENCE_STDVER >= 2017
179+
template<class... Args>
180+
reference emplace_back(Args&& ... args);
181+
#elif CPPREFERENCE_STDVER >= 2011
179182
template<class... Args>
180183
void emplace_back(Args&& ... args);
181184
#endif
@@ -187,7 +190,10 @@ public:
187190
void push_front(T&& value);
188191
#endif
189192

190-
#if CPPREFERENCE_STDVER>= 2011
193+
#if CPPREFERENCE_STDVER >= 2017
194+
template<class... Args>
195+
reference emplace_front(Args&& ... args);
196+
#elif CPPREFERENCE_STDVER >= 2011
191197
template<class... Args>
192198
void emplace_front(Args&& ... args);
193199
#endif

headers/vector

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ public:
191191
void push_back(T&& value);
192192
#endif
193193

194-
#if CPPREFERENCE_STDVER>= 2011
194+
#if CPPREFERENCE_STDVER >= 2017
195+
template<class... Args>
196+
reference emplace_back(Args&& ... args);
197+
#elif CPPREFERENCE_STDVER >= 2011
195198
template<class... Args>
196199
void emplace_back(Args&& ... args);
197200
#endif

0 commit comments

Comments
 (0)