Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
compat.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Settings/NamespaceSettings.hpp>
4
5#include <cstddef>
6#include <type_traits>
7#include <utility>
8
10
11#if __cplusplus >= 201703L
12
13namespace compat {
14using std::byte;
15using std::in_place;
16using std::in_place_t;
17using std::in_place_type;
18using std::in_place_type_t;
19} // namespace compat
20
21#else
22
23namespace compat {
24struct in_place_t {
25 explicit in_place_t() = default;
26};
28template <class T>
30 explicit in_place_type_t() = default;
31};
32template <class T>
34enum class byte : unsigned char {};
35} // namespace compat
36
37#endif
38
39#if __cplusplus >= 202002L
40
41namespace compat {
42using std::remove_cvref;
43} // namespace compat
44
45#else
46
47namespace compat {
48template <class T>
50 using type =
51 typename std::remove_cv<typename std::remove_reference<T>::type>::type;
52};
53} // namespace compat
54
55#endif
56
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
static in_place_t in_place
Definition compat.hpp:27
static in_place_type_t< T > in_place_type
Definition compat.hpp:33
in_place_t()=default
typename std::remove_cv< typename std::remove_reference< T >::type >::type type
Definition compat.hpp:50