]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/25_algorithms/move/deque_iterators/2.cc
1 // { dg-do run { target c++11 } }
2 // Copyright (C) 2019 Free Software Foundation, Inc.
4 // This file is part of the GNU ISO C++ Library. This library is free
5 // software; you can redistribute it and/or modify it under the
6 // terms of the GNU General Public License as published by the
7 // Free Software Foundation; either version 3, or (at your option)
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this library; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
24 #include <testsuite_hooks.h>
31 for (int i
= 0; i
!= _GLIBCXX_STD_C::__deque_buf_size(sizeof(int)); ++i
)
34 deque
<int> dest(d
.size(), 0);
36 move(d
.begin(), d
.end(), dest
.begin());
38 VERIFY( equal(dest
.begin(), dest
.end(), d
.begin()) );
46 for (int i
= 0; i
!= 4 * _GLIBCXX_STD_C::__deque_buf_size(sizeof(int)); ++i
)
49 deque
<int> dest(d
.size(), 0);
51 const deque
<int>& cd
= d
;
52 move(cd
.begin(), cd
.end(), dest
.begin());
54 VERIFY( equal(dest
.begin(), dest
.end(), cd
.begin()) );
60 for (int i
= 0; i
!= 1024; ++i
)
63 std::vector
<int> dest(d
.size(), 0);
65 std::move(d
.begin(), d
.end(), dest
.begin());
66 VERIFY( std::equal(dest
.begin(), dest
.end(), d
.begin()) );
72 for (int i
= 0; i
!= 1024; ++i
)
75 std::deque
<int> dest(v
.size() - 10, 0);
77 std::move(v
.begin() + 5, v
.end() - 5, dest
.begin());
78 VERIFY( std::equal(dest
.begin(), dest
.end(), v
.begin() + 5) );
84 for (int i
= 0; i
!= 1024; ++i
)
87 std::deque
<int> dest(l
.size(), 0);
89 std::move(l
.begin(), l
.end(), dest
.begin());
90 VERIFY( std::equal(dest
.begin(), dest
.end(), l
.begin()) );