Control Surface new-input
MIDI Control Surface library for Arduino
move.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <Settings/NamespaceSettings.hpp>
5 
7 
8 namespace enc_util {
9 
10 template <class T> struct remove_reference { typedef T type; };
11 template <class T> struct remove_reference<T &> { typedef T type; };
12 template <class T> struct remove_reference<T &&> { typedef T type; };
13 
14 template <class T>
15 typename remove_reference<T>::type &&
16 move(T &&t) {
17  return static_cast<typename remove_reference<T>::type &&>(t);
18 }
19 
20 template<typename T>
21 void swap(T &t1, T &t2) {
22  T temp = move(t1);
23  t1 = move(t2);
24  t2 = move(temp);
25 }
26 
27 } // namespace enc_util
28 
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: move.h:8
remove_reference< T >::type && move(T &&t)
Definition: move.h:16
void swap(T &t1, T &t2)
Definition: move.h:21