ARB
Main Page
Namespaces
Classes
Files
File List
File Members
TEMPLATES
arb_algo.h
Go to the documentation of this file.
1
// =========================================================== //
2
// //
3
// File : arb_algo.h //
4
// Purpose : idioms based on algorithm //
5
// //
6
// Coded by Ralf Westram (coder@reallysoft.de) in May 2012 //
7
// Institute of Microbiology (Technical University Munich) //
8
// http://www.arb-home.de/ //
9
// //
10
// =========================================================== //
11
12
#ifndef ARB_ALGO_H
13
#define ARB_ALGO_H
14
15
#ifndef _GLIBCXX_ALGORITHM
16
#include <algorithm>
17
#endif
18
19
template
<
typename
T>
20
CONSTEXPR_INLINE
const
T
&
force_in_range
(
const
T
& lower_bound,
const
T
& value,
const
T
& upper_bound) {
21
return
std::min
(
std::max
(lower_bound, value), upper_bound);
22
}
23
24
#else
25
#error arb_algo.h included twice
26
#endif // ARB_ALGO_H
force_in_range
CONSTEXPR_INLINE const T & force_in_range(const T &lower_bound, const T &value, const T &upper_bound)
Definition:
arb_algo.h:20
CONSTEXPR_INLINE
#define CONSTEXPR_INLINE
Definition:
cxxforward.h:111
T
Definition:
trnsprob.h:20
min
#define min(a, b)
Definition:
f2c.h:153
max
#define max(a, b)
Definition:
f2c.h:154
Generated by
1.8.8