Debian Codegraph @

libstdc++-v3/testsuite/24_iterators/normal_iterator/greedy_ops.cc

raw
1 // { dg-do compile }
2 // { dg-options "-Wno-unused-result" }
3
4 // Copyright (C) 2010-2025 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
20
21 #include <iterator>
22 #include <testsuite_greedy_ops.h>
23
24 namespace greedy_ops
25 {
26 struct C
27 {
28 typedef X* pointer;
29 };
30 }
31
32 void test01()
33 {
34 typedef __gnu_cxx::__normal_iterator<greedy_ops::X*,
35 greedy_ops::C> iterator_type;
36
37 iterator_type it(0);
38
39 it == it;
40 it != it;
41 it < it;
42 it <= it;
43 it > it;
44 it >= it;
45 it - it;
46 it + 1;
47 1 + it;
48 }
49
50 int main()
51 {
52 test01();
53 return 0;
54 }