Index: include/deque =================================================================== --- include/deque +++ include/deque @@ -110,8 +110,8 @@ void push_front(value_type&& v); void push_back(const value_type& v); void push_back(value_type&& v); - template reference emplace_front(Args&&... args); - template reference emplace_back(Args&&... args); + template reference emplace_front(Args&&... args); // reference in C++17 + template reference emplace_back(Args&&... args); // reference in C++17 template iterator emplace(const_iterator p, Args&&... args); iterator insert(const_iterator p, const value_type& v); iterator insert(const_iterator p, value_type&& v); @@ -1342,8 +1342,13 @@ void push_back(const value_type& __v); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_VARIADICS +#if _LIBCPP_STD_VER > 14 template reference emplace_front(_Args&&... __args); - template reference emplace_back(_Args&&... __args); + template reference emplace_back (_Args&&... __args); +#else + template void emplace_front(_Args&&... __args); + template void emplace_back (_Args&&... __args); +#endif template iterator emplace(const_iterator __p, _Args&&... __args); #endif // _LIBCPP_HAS_NO_VARIADICS void push_front(value_type&& __v); @@ -1822,7 +1827,11 @@ template template +#if _LIBCPP_STD_VER > 14 typename deque<_Tp, _Allocator>::reference +#else +void +#endif deque<_Tp, _Allocator>::emplace_back(_Args&&... __args) { allocator_type& __a = __base::__alloc(); @@ -1832,7 +1841,9 @@ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...); ++__base::size(); +#if _LIBCPP_STD_VER > 14 return *--__base::end(); +#endif } #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1870,7 +1881,11 @@ template template +#if _LIBCPP_STD_VER > 14 typename deque<_Tp, _Allocator>::reference +#else +void +#endif deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) { allocator_type& __a = __base::__alloc(); @@ -1880,7 +1895,9 @@ __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...); --__base::__start_; ++__base::size(); +#if _LIBCPP_STD_VER > 14 return *__base::begin(); +#endif } #endif // _LIBCPP_HAS_NO_VARIADICS Index: include/forward_list =================================================================== --- include/forward_list +++ include/forward_list @@ -87,7 +87,7 @@ reference front(); const_reference front() const; - template reference emplace_front(Args&&... args); + template reference emplace_front(Args&&... args); // reference in C++17 void push_front(const value_type& v); void push_front(value_type&& v); @@ -747,8 +747,12 @@ #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_VARIADICS +#if _LIBCPP_STD_VER > 14 template reference emplace_front(_Args&&... __args); +#else + template void emplace_front(_Args&&... __args); #endif +#endif void push_front(value_type&& __v); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES void push_front(const value_type& __v); @@ -1103,7 +1107,11 @@ template template +#if _LIBCPP_STD_VER > 14 typename forward_list<_Tp, _Alloc>::reference +#else +void +#endif forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args) { __node_allocator& __a = base::__alloc(); @@ -1113,7 +1121,9 @@ _VSTD::forward<_Args>(__args)...); __h->__next_ = base::__before_begin()->__next_; base::__before_begin()->__next_ = __h.release(); +#if _LIBCPP_STD_VER > 14 return base::__before_begin()->__next_->__value_; +#endif } #endif // _LIBCPP_HAS_NO_VARIADICS Index: include/list =================================================================== --- include/list +++ include/list @@ -93,10 +93,10 @@ size_type max_size() const noexcept; template - reference emplace_front(Args&&... args); + reference emplace_front(Args&&... args); // reference in C++17 void pop_front(); template - reference emplace_back(Args&&... args); + reference emplace_back(Args&&... args); // reference in C++17 void pop_back(); void push_front(const value_type& x); void push_front(value_type&& x); @@ -969,9 +969,17 @@ void push_back(value_type&& __x); #ifndef _LIBCPP_HAS_NO_VARIADICS template +#if _LIBCPP_STD_VER > 14 reference emplace_front(_Args&&... __args); +#else + void emplace_front(_Args&&... __args); +#endif template +#if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); +#else + void emplace_back(_Args&&... __args); +#endif template iterator emplace(const_iterator __p, _Args&&... __args); #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1600,7 +1608,11 @@ template template +#if _LIBCPP_STD_VER > 14 typename list<_Tp, _Alloc>::reference +#else +void +#endif list<_Tp, _Alloc>::emplace_front(_Args&&... __args) { __node_allocator& __na = base::__node_alloc(); @@ -1609,12 +1621,20 @@ __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...); __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link()); ++base::__sz(); +#if _LIBCPP_STD_VER > 14 return __hold.release()->__value_; +#else + __hold.release(); +#endif } template template +#if _LIBCPP_STD_VER > 14 typename list<_Tp, _Alloc>::reference +#else +void +#endif list<_Tp, _Alloc>::emplace_back(_Args&&... __args) { __node_allocator& __na = base::__node_alloc(); @@ -1624,7 +1644,11 @@ __link_pointer __nl = __hold->__as_link(); __link_nodes_at_back(__nl, __nl); ++base::__sz(); +#if _LIBCPP_STD_VER > 14 return __hold.release()->__value_; +#else + __hold.release(); +#endif } template Index: include/queue =================================================================== --- include/queue +++ include/queue @@ -63,7 +63,7 @@ void push(const value_type& v); void push(value_type&& v); - template reference emplace(Args&&... args); + template reference emplace(Args&&... args); // reference in C++17 void pop(); void swap(queue& q) noexcept(is_nothrow_swappable_v) @@ -292,8 +292,13 @@ #ifndef _LIBCPP_HAS_NO_VARIADICS template _LIBCPP_INLINE_VISIBILITY +#if _LIBCPP_STD_VER > 14 reference emplace(_Args&&... __args) { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} +#else + void emplace(_Args&&... __args) + { c.emplace_back(_VSTD::forward<_Args>(__args)...);} +#endif #endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/stack =================================================================== --- include/stack +++ include/stack @@ -55,7 +55,7 @@ void push(const value_type& x); void push(value_type&& x); - template reference emplace(Args&&... args); + template reference emplace(Args&&... args); // reference in C++17 void pop(); void swap(stack& c) noexcept(is_nothrow_swappable_v) @@ -199,8 +199,13 @@ #ifndef _LIBCPP_HAS_NO_VARIADICS template _LIBCPP_INLINE_VISIBILITY +#if _LIBCPP_STD_VER > 14 reference emplace(_Args&&... __args) { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} +#else + void emplace(_Args&&... __args) + { c.emplace_back(_VSTD::forward<_Args>(__args)...);} +#endif #endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY Index: include/vector =================================================================== --- include/vector +++ include/vector @@ -99,7 +99,7 @@ void push_back(const value_type& x); void push_back(value_type&& x); template - reference emplace_back(Args&&... args); + reference emplace_back(Args&&... args); // reference in C++17 void pop_back(); template iterator emplace(const_iterator position, Args&&... args); @@ -218,7 +218,7 @@ const_reference back() const; void push_back(const value_type& x); - template reference emplace_back(Args&&... args); // C++14 + template reference emplace_back(Args&&... args); // C++14; reference in C++17 void pop_back(); template iterator emplace(const_iterator position, Args&&... args); // C++14 @@ -679,7 +679,11 @@ #ifndef _LIBCPP_HAS_NO_VARIADICS template _LIBCPP_INLINE_VISIBILITY +#if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); +#else + void emplace_back(_Args&&... __args); +#endif #endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY @@ -1625,7 +1629,11 @@ template template inline +#if _LIBCPP_STD_VER > 14 typename vector<_Tp, _Allocator>::reference +#else +void +#endif vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) { if (this->__end_ < this->__end_cap()) @@ -1639,7 +1647,9 @@ } else __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...); +#if _LIBCPP_STD_VER > 14 return this->back(); +#endif } #endif // _LIBCPP_HAS_NO_VARIADICS @@ -2336,9 +2346,16 @@ void push_back(const value_type& __x); #if _LIBCPP_STD_VER > 11 template - _LIBCPP_INLINE_VISIBILITY reference emplace_back(_Args&&... __args) { +#if _LIBCPP_STD_VER > 14 + _LIBCPP_INLINE_VISIBILITY reference emplace_back(_Args&&... __args) +#else + _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args) +#endif + { push_back ( value_type ( _VSTD::forward<_Args>(__args)... )); +#if _LIBCPP_STD_VER > 14 return this->back(); +#endif } #endif Index: test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp =================================================================== --- test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp +++ test/std/containers/container.adaptors/queue/queue.defn/emplace.pass.cpp @@ -12,10 +12,14 @@ // // template reference emplace(Args&&... args); +// return type is 'reference' in C++17; 'void' before + #include #include +#include "test_macros.h" + #include "../../../Emplaceable.h" int main() @@ -22,6 +26,7 @@ { typedef Emplaceable T; std::queue q; +#if TEST_STD_VER > 14 T& r1 = q.emplace(1, 2.5); assert(&r1 == &q.back()); T& r2 = q.emplace(2, 3.5); @@ -28,9 +33,14 @@ assert(&r2 == &q.back()); T& r3 = q.emplace(3, 4.5); assert(&r3 == &q.back()); + assert(&r1 == &q.front()); +#else + q.emplace(1, 2.5); + q.emplace(2, 3.5); + q.emplace(3, 4.5); +#endif + assert(q.size() == 3); assert(q.front() == Emplaceable(1, 2.5)); assert(q.back() == Emplaceable(3, 4.5)); - assert(&r3 == &q.back()); - assert(&r1 == &q.front()); } Index: test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp =================================================================== --- test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp +++ test/std/containers/container.adaptors/stack/stack.defn/emplace.pass.cpp @@ -12,10 +12,13 @@ // // template reference emplace(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include +#include "test_macros.h" + #include "../../../Emplaceable.h" int main() @@ -22,6 +25,7 @@ { typedef Emplaceable T; std::stack q; +#if TEST_STD_VER > 14 T& r1 = q.emplace(1, 2.5); assert(&r1 == &q.top()); T& r2 = q.emplace(2, 3.5); @@ -28,6 +32,11 @@ assert(&r2 == &q.top()); T& r3 = q.emplace(3, 4.5); assert(&r3 == &q.top()); +#else + q.emplace(1, 2.5); + q.emplace(2, 3.5); + q.emplace(3, 4.5); +#endif assert(q.size() == 3); assert(q.top() == Emplaceable(3, 4.5)); } Index: test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp =================================================================== --- test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp +++ test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp @@ -12,6 +12,7 @@ // // template reference emplace_back(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include @@ -49,15 +50,21 @@ test(C& c1) { typedef typename C::iterator I; + std::size_t c1_osize = c1.size(); +#if TEST_STD_VER > 14 typedef typename C::reference Ref; - std::size_t c1_osize = c1.size(); Ref ref = c1.emplace_back(Emplaceable(1, 2.5)); +#else + c1.emplace_back(Emplaceable(1, 2.5)); +#endif assert(c1.size() == c1_osize + 1); assert(distance(c1.begin(), c1.end()) == static_cast(c1.size())); I i = c1.end(); assert(*--i == Emplaceable(1, 2.5)); +#if TEST_STD_VER > 14 assert(&(*i) == &ref); +#endif } template Index: test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp =================================================================== --- test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp +++ test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp @@ -12,6 +12,7 @@ // // template reference emplace_front(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include @@ -20,6 +21,7 @@ #include "test_macros.h" #include "../../../Emplaceable.h" #include "min_allocator.h" +#include "test_allocator.h" template C @@ -48,15 +50,21 @@ test(C& c1) { typedef typename C::iterator I; + std::size_t c1_osize = c1.size(); +#if TEST_STD_VER > 14 typedef typename C::reference Ref; - std::size_t c1_osize = c1.size(); Ref res_ref = c1.emplace_front(Emplaceable(1, 2.5)); +#else + c1.emplace_front(Emplaceable(1, 2.5)); +#endif assert(c1.size() == c1_osize + 1); assert(distance(c1.begin(), c1.end()) == static_cast(c1.size())); I i = c1.begin(); assert(*i == Emplaceable(1, 2.5)); +#if TEST_STD_VER > 14 assert(&res_ref == &(*i)); +#endif } template @@ -84,4 +92,15 @@ for (int j = 0; j < N; ++j) testN> >(rng[i], rng[j]); } + { + std::deque> c; + c.emplace_front(); + assert(c.size() == 1); + c.emplace_front(1, 2, 3); + assert(c.size() == 2); + c.emplace_front(); + assert(c.size() == 3); + c.emplace_front(1, 2, 3); + assert(c.size() == 4); + } } Index: test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp =================================================================== --- test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp +++ test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_front.pass.cpp @@ -12,10 +12,13 @@ // // template reference emplace_front(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include +#include "test_macros.h" + #include "../../../Emplaceable.h" #include "min_allocator.h" @@ -25,6 +28,7 @@ typedef Emplaceable T; typedef std::forward_list C; C c; +#if TEST_STD_VER > 14 T& r1 = c.emplace_front(); assert(c.front() == Emplaceable()); assert(&r1 == &c.front()); @@ -32,6 +36,13 @@ T& r2 = c.emplace_front(1, 2.5); assert(c.front() == Emplaceable(1, 2.5)); assert(&r2 == &c.front()); +#else + c.emplace_front(); + assert(c.front() == Emplaceable()); + assert(distance(c.begin(), c.end()) == 1); + c.emplace_front(1, 2.5); + assert(c.front() == Emplaceable(1, 2.5)); +#endif assert(*next(c.begin()) == Emplaceable()); assert(distance(c.begin(), c.end()) == 2); } @@ -39,6 +50,7 @@ typedef Emplaceable T; typedef std::forward_list> C; C c; +#if TEST_STD_VER > 14 T& r1 = c.emplace_front(); assert(c.front() == Emplaceable()); assert(&r1 == &c.front()); @@ -46,6 +58,13 @@ T& r2 = c.emplace_front(1, 2.5); assert(c.front() == Emplaceable(1, 2.5)); assert(&r2 == &c.front()); +#else + c.emplace_front(); + assert(c.front() == Emplaceable()); + assert(distance(c.begin(), c.end()) == 1); + c.emplace_front(1, 2.5); + assert(c.front() == Emplaceable(1, 2.5)); +#endif assert(*next(c.begin()) == Emplaceable()); assert(distance(c.begin(), c.end()) == 2); } Index: test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp =================================================================== --- test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp +++ test/std/containers/sequences/list/list.modifiers/emplace_back.pass.cpp @@ -12,10 +12,12 @@ // // template reference emplace_back(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include +#include "test_macros.h" #include "min_allocator.h" class A @@ -37,6 +39,7 @@ { { std::list c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_back(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.back()); @@ -45,13 +48,22 @@ A& r2 = c.emplace_back(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.back()); +#else + c.emplace_back(2, 3.5); + assert(c.size() == 1); assert(c.front().geti() == 2); assert(c.front().getd() == 3.5); + c.emplace_back(3, 4.5); + assert(c.size() == 2); +#endif + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); assert(c.back().geti() == 3); assert(c.back().getd() == 4.5); } { std::list> c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_back(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.back()); @@ -60,8 +72,16 @@ A& r2 = c.emplace_back(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.back()); +#else + c.emplace_back(2, 3.5); + assert(c.size() == 1); assert(c.front().geti() == 2); assert(c.front().getd() == 3.5); + c.emplace_back(3, 4.5); + assert(c.size() == 2); +#endif + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); assert(c.back().geti() == 3); assert(c.back().getd() == 4.5); } Index: test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp =================================================================== --- test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp +++ test/std/containers/sequences/list/list.modifiers/emplace_front.pass.cpp @@ -12,6 +12,7 @@ // // template reference emplace_front(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include @@ -37,6 +38,7 @@ { { std::list c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_front(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.front()); @@ -45,13 +47,23 @@ A& r2 = c.emplace_front(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.front()); +#else + c.emplace_front(2, 3.5); + assert(c.size() == 1); + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); + c.emplace_front(3, 4.5); + assert(c.size() == 2); +#endif assert(c.front().geti() == 3); assert(c.front().getd() == 4.5); assert(c.back().geti() == 2); assert(c.back().getd() == 3.5); } + { std::list> c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_front(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.front()); @@ -60,6 +72,14 @@ A& r2 = c.emplace_front(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.front()); +#else + c.emplace_front(2, 3.5); + assert(c.size() == 1); + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); + c.emplace_front(3, 4.5); + assert(c.size() == 2); +#endif assert(c.front().geti() == 3); assert(c.front().getd() == 4.5); assert(c.back().geti() == 2); Index: test/std/containers/sequences/vector.bool/emplace_back.pass.cpp =================================================================== --- test/std/containers/sequences/vector.bool/emplace_back.pass.cpp +++ test/std/containers/sequences/vector.bool/emplace_back.pass.cpp @@ -12,9 +12,11 @@ // vector.bool // template reference emplace_back(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include +#include "test_macros.h" #include "min_allocator.h" int main() @@ -21,8 +23,9 @@ { { typedef std::vector C; + C c; +#if TEST_STD_VER > 14 typedef C::reference Ref; - C c; Ref r1 = c.emplace_back(); assert(c.size() == 1); assert(c.front() == false); @@ -36,19 +39,27 @@ r2 = false; assert(c.back() == false); r2 = true; - Ref r3 = c.emplace_back(1 == 1); +#else + c.emplace_back(); + assert(c.size() == 1); + assert(c.front() == false); + c.emplace_back(true); + assert(c.size() == 2); + assert(c.front() == false); + assert(c.back() == true); +#endif + c.emplace_back(1 == 1); assert(c.size() == 3); assert(c.front() == false); assert(c[1] == true); assert(c.back() == true); - r3 = false; - assert(c.back() == false); } { typedef std::vector> C; - typedef C::reference Ref; C c; +#if TEST_STD_VER > 14 + typedef C::reference Ref; Ref r1 = c.emplace_back(); assert(c.size() == 1); assert(c.front() == false); @@ -62,6 +73,15 @@ r2 = false; assert(c.back() == false); r2 = true; +#else + c.emplace_back(); + assert(c.size() == 1); + assert(c.front() == false); + c.emplace_back(true); + assert(c.size() == 2); + assert(c.front() == false); + assert(c.back() == true); +#endif c.emplace_back(1 == 1); assert(c.size() == 3); assert(c.front() == false); Index: test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp =================================================================== --- test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp +++ test/std/containers/sequences/vector/vector.modifiers/emplace_back.pass.cpp @@ -12,9 +12,11 @@ // // template reference emplace_back(Args&&... args); +// return type is 'reference' in C++17; 'void' before #include #include +#include "test_macros.h" #include "test_allocator.h" #include "min_allocator.h" #include "test_allocator.h" @@ -56,6 +58,7 @@ { { std::vector c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_back(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.back()); @@ -65,8 +68,17 @@ A& r2 = c.emplace_back(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.back()); +#else + c.emplace_back(2, 3.5); + assert(c.size() == 1); assert(c.front().geti() == 2); assert(c.front().getd() == 3.5); + assert(is_contiguous_container_asan_correct(c)); + c.emplace_back(3, 4.5); + assert(c.size() == 2); +#endif + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); assert(c.back().geti() == 3); assert(c.back().getd() == 4.5); assert(is_contiguous_container_asan_correct(c)); @@ -73,6 +85,7 @@ } { std::vector > c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_back(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.back()); @@ -82,8 +95,17 @@ A& r2 = c.emplace_back(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.back()); +#else + c.emplace_back(2, 3.5); + assert(c.size() == 1); assert(c.front().geti() == 2); assert(c.front().getd() == 3.5); + assert(is_contiguous_container_asan_correct(c)); + c.emplace_back(3, 4.5); + assert(c.size() == 2); +#endif + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); assert(c.back().geti() == 3); assert(c.back().getd() == 4.5); assert(is_contiguous_container_asan_correct(c)); @@ -90,6 +112,7 @@ } { std::vector> c; +#if TEST_STD_VER > 14 A& r1 = c.emplace_back(2, 3.5); assert(c.size() == 1); assert(&r1 == &c.back()); @@ -99,8 +122,17 @@ A& r2 = c.emplace_back(3, 4.5); assert(c.size() == 2); assert(&r2 == &c.back()); +#else + c.emplace_back(2, 3.5); + assert(c.size() == 1); assert(c.front().geti() == 2); assert(c.front().getd() == 3.5); + assert(is_contiguous_container_asan_correct(c)); + c.emplace_back(3, 4.5); + assert(c.size() == 2); +#endif + assert(c.front().geti() == 2); + assert(c.front().getd() == 3.5); assert(c.back().geti() == 3); assert(c.back().getd() == 4.5); assert(is_contiguous_container_asan_correct(c));