Start working on a VFS implementation #22

Closed
apio wants to merge 44 commits from oop-vfs into main
Showing only changes of commit 6eff41e7af - Show all commits

View File

@ -138,26 +138,16 @@ template <typename T> class Option
private:
struct Storage
{
u8 buffer[sizeof(T)];
T* fetch_ptr()
{
return (T*)buffer;
}
alignas(T) u8 buffer[sizeof(T)];
T& fetch_reference()
{
return *fetch_ptr();
}
const T* fetch_ptr() const
{
return (const T*)buffer;
return *__builtin_launder(reinterpret_cast<T*>(&buffer));
}
const T& fetch_reference() const
{
return *fetch_ptr();
return *__builtin_launder(reinterpret_cast<const T*>(&buffer));
}
void store_reference(const T& ref)