This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
MinMaxFix.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Arduino.h>
5 
7 #ifdef min
8 #undef min
9 #endif
10 template <class T, class U>
11 constexpr auto min(const T &a, const U &b) -> decltype(b < a ? b : a) {
12  return b < a ? b : a;
13 }
14 
15 #ifdef max
16 #undef max
17 #endif
18 template <class T, class U>
19 constexpr auto max(const T &a, const U &b) -> decltype(b < a ? b : a) {
20  return a < b ? b : a;
21 }
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
NamespaceSettings.hpp
max
constexpr auto max(const T &a, const U &b) -> decltype(b< a ? b :a)
Definition: MinMaxFix.hpp:19
min
constexpr auto min(const T &a, const U &b) -> decltype(b< a ? b :a)
Definition: MinMaxFix.hpp:11