maths: add maxmin query
This commit is contained in:
parent
065daa96c6
commit
89a4641c33
13
maths.hpp
13
maths.hpp
@ -645,6 +645,19 @@ namespace cruft {
|
|||||||
min (std::array<ValueT,CountV> &&) = delete;
|
min (std::array<ValueT,CountV> &&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
///------------------------------------------------------------------------
|
||||||
|
/// Returns an ordered pair where the elements come from the parameters.
|
||||||
|
template <typename ValueT>
|
||||||
|
std::pair<ValueT,ValueT>
|
||||||
|
maxmin (ValueT a, ValueT b)
|
||||||
|
{
|
||||||
|
if (a >= b)
|
||||||
|
return { a, b };
|
||||||
|
else
|
||||||
|
return { b, a };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Limiting functions
|
// Limiting functions
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user