Control Surface master
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
8namespace enc_util {
9
10template <class T> struct remove_reference { typedef T type; };
11template <class T> struct remove_reference<T &> { typedef T type; };
12template <class T> struct remove_reference<T &&> { typedef T type; };
13
14template <class T>
16move(T &&t) {
17 return static_cast<typename remove_reference<T>::type &&>(t);
18}
19
20template<typename T>
21void 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
void swap(T &t1, T &t2)
Definition: move.h:21
remove_reference< T >::type && move(T &&t)
Definition: move.h:16