Arduino Helpers master
Utility library for Arduino
MinMaxFix.hpp
Go to the documentation of this file.
1#pragma once
2
4
6
8
11template <class T, class U>
12constexpr auto min(const T &a, const U &b) -> decltype(b < a ? b : a) {
13 return b < a ? b : a;
14}
15
18template <class T, class U>
19constexpr auto max(const T &a, const U &b) -> decltype(a < b ? b : a) {
20 return a < b ? b : a;
21}
22
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
constexpr auto min(const T &a, const U &b) -> decltype(b< a ? b :a)
Return the smaller of two numbers/objects.
Definition: MinMaxFix.hpp:12
constexpr auto max(const T &a, const U &b) -> decltype(a< b ? b :a)
Return the larger of two numbers/objects.
Definition: MinMaxFix.hpp:19