[glacier] Add UniquePtr and Move

This commit is contained in:
Drew Galbraith 2023-06-26 11:13:06 -07:00
parent b7a962cc26
commit 84d3c33938
2 changed files with 76 additions and 0 deletions

25
lib/glacier/memory/move.h Normal file
View file

@ -0,0 +1,25 @@
#pragma once
namespace glcr {
template <typename T>
struct RemoveReference {
typedef T type;
};
template <typename T>
struct RemoveReference<T&> {
typedef T type;
};
template <typename T>
struct RemoveReference<T&&> {
typedef T type;
};
template <typename T>
typename RemoveReference<T>::type&& Move(T&& arg) {
return static_cast<typename RemoveReference<T>::type&&>(arg);
}
} // namespace glcr