1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-04 02:01:58 +00:00
This commit is contained in:
momo5502
2022-03-26 13:50:56 +01:00
parent b56b9e5afa
commit eef4a9a5a2
18 changed files with 225 additions and 63 deletions

View File

@ -11,44 +11,3 @@ void __cdecl operator delete(void *ptr, size_t);
void __cdecl operator delete(void *ptr);
void __cdecl operator delete[](void *ptr, size_t);
void __cdecl operator delete[](void *ptr);
// TEMPLATE CLASS remove_reference
template<class _Ty>
struct remove_reference
{ // remove reference
typedef _Ty type;
};
template<class _Ty>
struct remove_reference<_Ty&>
{ // remove reference
typedef _Ty type;
};
template<class _Ty>
struct remove_reference<_Ty&&>
{ // remove rvalue reference
typedef _Ty type;
};
template <typename T>
typename remove_reference<T>::type&& move(T&& arg)
{
return static_cast<typename remove_reference<T>::type&&>(arg);
}
// TEMPLATE FUNCTION forward
template<class _Ty> inline
constexpr _Ty&& forward(
typename remove_reference<_Ty>::type& _Arg)
{ // forward an lvalue as either an lvalue or an rvalue
return (static_cast<_Ty&&>(_Arg));
}
template<class _Ty> inline
constexpr _Ty&& forward(
typename remove_reference<_Ty>::type&& _Arg)
{ // forward an rvalue as an rvalue
return (static_cast<_Ty&&>(_Arg));
}