]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/20_util/function_objects/comparisons_void.cc
1 // { dg-do compile { target c++14 } }
3 // Copyright (C) 2013-2018 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
28 L
operator+(const R
&) const { return *this; }
29 L
operator-(const R
&) const { return *this; }
30 L
operator*(const R
&) const { return *this; }
31 L
operator/(const R
&) const { return *this; }
32 L
operator%(const R
&) const { return *this; }
33 L
operator-() const { return *this; }
35 bool operator==(const R
&) const { return true; }
36 bool operator!=(const R
&) const { return false; }
37 bool operator<(const R
&) const { return false; }
38 bool operator<=(const R
&) const { return true; }
39 bool operator>(const R
&) const { return false; }
40 bool operator>=(const R
&) const { return true; }
42 bool operator&&(const R
&) const { return true; }
43 bool operator||(const R
&) const { return true; }
44 bool operator!() const { return false; }
46 int operator&(const R
&) const { return 1; }
47 int operator|(const R
&) const { return 1; }
48 int operator^(const R
&) const { return 0; }
49 int operator~() const { return 0; }
55 // test unary function objects
56 template<typename F
, typename Check
= typename
F::is_transparent
>
64 // test binary function objects
65 template<typename F
, typename Check
= typename
F::is_transparent
>
73 auto plus
= test2( std::plus
<>() );
74 auto minus
= test2( std::minus
<>() );
75 auto multiplies
= test2( std::multiplies
<>() );
76 auto divides
= test2( std::divides
<>() );
77 auto modulus
= test2( std::modulus
<>() );
78 auto negate
= test1( std::negate
<>() );
80 auto equal_to
= test2( std::equal_to
<>() );
81 auto not_equal_to
= test2( std::not_equal_to
<>() );
82 auto greater
= test2( std::greater
<>() );
83 auto less
= test2( std::less
<>() );
84 auto greater_equal
= test2( std::greater_equal
<>() );
85 auto less_equal
= test2( std::less_equal
<>() );
87 auto logical_and
= test2( std::logical_and
<>() );
88 auto logical_or
= test2( std::logical_or
<>() );
89 auto logical_not
= test1( std::logical_not
<>() );
91 auto bit_and
= test2( std::bit_and
<>() );
92 auto bit_or
= test2( std::bit_or
<>() );
93 auto bit_xor
= test2( std::bit_xor
<>() );
94 auto bit_not
= test1( std::bit_not
<>() );