diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-08-24 17:37:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-08-24 17:37:53 +0000 |
commit | e947f967d1e30b3973f8a789e682da57481a5ece (patch) | |
tree | d05acd9c81f71323c19b08b989291f03b5866e93 /test/std/containers/associative/map/map.cons/move_alloc.pass.cpp | |
parent | a9eb25783e00a819962a7f2b5755c203894de36b (diff) |
Vendor import of libc++ release_39 branch r279477:vendor/libc++/libc++-release_390-r280324vendor/libc++/libc++-release_39-r279689vendor/libc++/libc++-release_39-r279477
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=304765
svn path=/vendor/libc++/libc++-release_390-r280324/; revision=305295; tag=vendor/libc++/libc++-release_390-r280324
Diffstat (limited to 'test/std/containers/associative/map/map.cons/move_alloc.pass.cpp')
-rw-r--r-- | test/std/containers/associative/map/map.cons/move_alloc.pass.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp index 4ccf56118aec..8349f13fdebf 100644 --- a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp @@ -229,6 +229,45 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } + { + typedef std::pair<MoveOnly, MoveOnly> V; + typedef std::pair<const MoveOnly, MoveOnly> VC; + typedef test_compare<std::less<MoveOnly> > C; + typedef explicit_allocator<VC> A; + typedef std::map<MoveOnly, MoveOnly, C, A> M; + typedef std::move_iterator<V*> I; + V a1[] = + { + V(1, 1), + V(1, 2), + V(1, 3), + V(2, 1), + V(2, 2), + V(2, 3), + V(3, 1), + V(3, 2), + V(3, 3) + }; + M m1(I(a1), I(a1+sizeof(a1)/sizeof(a1[0])), C(5), A{}); + V a2[] = + { + V(1, 1), + V(1, 2), + V(1, 3), + V(2, 1), + V(2, 2), + V(2, 3), + V(3, 1), + V(3, 2), + V(3, 3) + }; + M m2(I(a2), I(a2+sizeof(a2)/sizeof(a2[0])), C(5), A{}); + M m3(std::move(m1), A{}); + assert(m3 == m2); + assert(m3.get_allocator() == A{}); + assert(m3.key_comp() == C(5)); + assert(m1.empty()); + } #endif #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } |