Kernel: Add a move() function

The standard C++ move() function.
This commit is contained in:
apio 2022-10-14 19:04:56 +02:00
parent f82fbbe60c
commit e0aa552fae
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,6 @@
#pragma once
template <typename T> inline T&& move(T& lvalue)
{
return (T &&) lvalue;
}

View File

@ -4,6 +4,7 @@
#include "log/Log.h" #include "log/Log.h"
#include "memory/PMM.h" #include "memory/PMM.h"
#include "memory/VMM.h" #include "memory/VMM.h"
#include "utils/move.h"
AddressSpace AddressSpace::create() AddressSpace AddressSpace::create()
{ {
@ -11,7 +12,7 @@ AddressSpace AddressSpace::create()
result.m_pml4 = (PageTable*)PMM::request_page(); result.m_pml4 = (PageTable*)PMM::request_page();
result.m_cloned = false; result.m_cloned = false;
VMM::install_kernel_page_directory_into_address_space(result); VMM::install_kernel_page_directory_into_address_space(result);
return result; return move(result);
} }
void AddressSpace::destroy() void AddressSpace::destroy()