moveable.cc 1.21 KB
Newer Older
1
// { dg-do compile { target c++11 } }
Chris Jefferson committed
2

3
// Copyright (C) 2005-2016 Free Software Foundation, Inc.
4 5 6 7
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
8
// Free Software Foundation; either version 3, or (at your option)
9 10 11 12 13 14 15 16
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
17 18
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.
19

Chris Jefferson committed
20 21 22 23
// 25.2.4 Swap Ranges

#undef _GLIBCXX_CONCEPT_CHECKS

24
#include <algorithm>
Chris Jefferson committed
25 26 27
#include <testsuite_iterators.h>

using __gnu_test::forward_iterator_wrapper;
28

29
struct X 
Chris Jefferson committed
30
{ 
31 32 33
  X() = delete;
  X(const X&) = delete;
  void operator=(const X&) = delete;
Chris Jefferson committed
34
};
35

Chris Jefferson committed
36 37
void
swap(X&, X&) { }
38

Chris Jefferson committed
39 40 41 42
void
test1(forward_iterator_wrapper<X>& begin, forward_iterator_wrapper<X>& end, 
      forward_iterator_wrapper<X>& begin2)
{ std::swap_ranges(begin, end, begin2); }