dune-common  2.2.0
binaryfunctions.hh
Go to the documentation of this file.
1 #ifndef DUNE_BINARYFUNCTIONS_HH
2 #define DUNE_BINARYFUNCTIONS_HH
3 
8 #include<functional>
9 #include<algorithm>
10 
11 namespace Dune
12 {
13  template<typename Type>
14  struct Min
15  : std::binary_function<Type,Type,Type>
16  {
17  Type operator()(const Type& t1, const Type& t2) const
18  {
19  return std::min(t1,t2);
20  }
21  };
22 
23  template<typename Type>
24  struct Max
25  : std::binary_function<Type,Type,Type>
26  {
27  Type operator()(const Type& t1, const Type& t2) const
28  {
29  return std::max(t1,t2);
30  }
31  };
32 }
33 
34 #endif