Control Surface master
MIDI Control Surface library for Arduino
TypeTraits.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Settings/NamespaceSettings.hpp>
4
5#include <AH/STL/type_traits>
6#include <AH/STL/utility>
7
9
10template <class...>
11using void_t = void;
12
13template <class, class = void>
14struct has_method_begin : std::false_type {};
15
16template <class T>
18 : std::true_type {};
19
21template <class T>
22typename std::enable_if<has_method_begin<T>::value>::type
24 t.begin();
25}
26
27template <class T>
28typename std::enable_if<!has_method_begin<T>::value>::type
30
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
std::enable_if< has_method_begin< T >::value >::type begin_if_possible(T &t)
Calls the begin() method of t if that method exists.
Definition: TypeTraits.hpp:23
void void_t
Definition: TypeTraits.hpp:11