mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
AK: Use Noncopyable.h
in NonnullRawPtr
This commit is contained in:
parent
b35fbe77c6
commit
db28ed8f51
1 changed files with 4 additions and 24 deletions
|
@ -7,12 +7,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/Traits.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
requires(!IsLvalueReference<T> && !IsRvalueReference<T>) class [[nodiscard]] NonnullRawPtr {
|
||||
AK_MAKE_DEFAULT_COPYABLE(NonnullRawPtr);
|
||||
AK_MAKE_DEFAULT_MOVABLE(NonnullRawPtr);
|
||||
|
||||
public:
|
||||
using ValueType = T;
|
||||
|
||||
|
@ -23,30 +27,6 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
NonnullRawPtr(NonnullRawPtr const& other)
|
||||
: m_ptr(other.m_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
NonnullRawPtr(NonnullRawPtr&& other)
|
||||
: m_ptr(other.m_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
NonnullRawPtr& operator=(NonnullRawPtr const& other)
|
||||
{
|
||||
m_ptr = other.m_ptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
NonnullRawPtr& operator=(NonnullRawPtr&& other)
|
||||
{
|
||||
m_ptr = other.m_ptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator bool() const = delete;
|
||||
bool operator!() const = delete;
|
||||
|
||||
|
|
Loading…
Reference in a new issue