dune-common  2.11
binaryfunctions.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 #ifndef DUNE_BINARYFUNCTIONS_HH
6 #define DUNE_BINARYFUNCTIONS_HH
7 
12 #include <algorithm>
13 
14 namespace Dune
15 {
16  template<typename Type>
17  struct Min
18  {
19  using first_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
20 
21  using second_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
22 
23  using result_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
24 
25  Type operator()(const Type& t1, const Type& t2) const
26  {
27  using std::min;
28  return min(t1,t2);
29  }
30  };
31 
32  template<typename Type>
33  struct Max
34  {
35  using first_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
36 
37  using second_argument_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
38 
39  using result_type [[deprecated("This type alias is deprecated following similar deprecations in C++17")]] = Type;
40 
41  Type operator()(const Type& t1, const Type& t2) const
42  {
43  using std::max;
44  return max(t1,t2);
45  }
46  };
47 }
48 
49 #endif
Type second_argument_type
Definition: binaryfunctions.hh:37
Type operator()(const Type &t1, const Type &t2) const
Definition: binaryfunctions.hh:25
Definition: binaryfunctions.hh:17
Type result_type
Definition: binaryfunctions.hh:23
constexpr auto max
Function object that returns the greater of the given values.
Definition: hybridutilities.hh:489
Type result_type
Definition: binaryfunctions.hh:39
Type first_argument_type
Definition: binaryfunctions.hh:35
Dune namespace
Definition: alignedallocator.hh:12
Definition: binaryfunctions.hh:33
Type second_argument_type
Definition: binaryfunctions.hh:21
constexpr auto min
Function object that returns the smaller of the given values.
Definition: hybridutilities.hh:511
Type operator()(const Type &t1, const Type &t2) const
Definition: binaryfunctions.hh:41
Type first_argument_type
Definition: binaryfunctions.hh:19