Dune Core Modules (unstable)

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
14namespace 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
constexpr auto max
Function object that returns the greater of the given values.
Definition: hybridutilities.hh:484
constexpr auto min
Function object that returns the smaller of the given values.
Definition: hybridutilities.hh:506
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)