3#ifndef DUNE_COMMON_RANGE_UTILITIES_HH
4#define DUNE_COMMON_RANGE_UTILITIES_HH
31 typename std::enable_if<is_range<T>::value,
int>::type = 0>
32 typename T::value_type
34 using std::max_element;
35 return *max_element(v.begin(), v.end());
39 typename std::enable_if<!is_range<T>::value,
int>::type = 0>
40 const T &
max_value(
const T & v) {
return v; }
48 typename std::enable_if<is_range<T>::value,
int>::type = 0>
49 typename T::value_type
51 using std::min_element;
52 return *min_element(v.begin(), v.end());
56 typename std::enable_if<!is_range<T>::value,
int>::type = 0>
57 const T &
min_value(
const T & v) {
return v; }
65 typename std::enable_if<is_range<T>::value,
int>::type = 0>
68 for (
const auto & e : v)
74 typename std::enable_if<!is_range<T>::value,
int>::type = 0>
75 bool any_true(
const T & v) {
return v; }
77 template<std::
size_t N>
78 bool any_true(
const std::bitset<N> & b)
89 typename std::enable_if<is_range<T>::value,
int>::type = 0>
92 for (
const auto & e : v)
98 typename std::enable_if<!is_range<T>::value,
int>::type = 0>
99 bool all_true(
const T & v) {
return v; }
101 template<std::
size_t N>
102 bool all_true(
const std::bitset<N> & b)
bool any_true(const T &v)
similar to std::bitset<N>::any() return true, if any entries is true
Definition: rangeutilities.hh:66
bool all_true(const T &v)
similar to std::bitset<N>::all() return true, if any entries is true
Definition: rangeutilities.hh:90
T::value_type min_value(const T &v)
compute the minimum value over a range
Definition: rangeutilities.hh:50
T::value_type max_value(const T &v)
compute the maximum value over a range
Definition: rangeutilities.hh:33
Dune namespace.
Definition: alignment.hh:11
Traits for type conversions and type information.