mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Forward.h>
|
#include <AK/Forward.h>
|
||||||
|
#include <AK/Noncopyable.h>
|
||||||
#include <AK/Traits.h>
|
#include <AK/Traits.h>
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
requires(!IsLvalueReference<T> && !IsRvalueReference<T>) class [[nodiscard]] NonnullRawPtr {
|
requires(!IsLvalueReference<T> && !IsRvalueReference<T>) class [[nodiscard]] NonnullRawPtr {
|
||||||
|
AK_MAKE_DEFAULT_COPYABLE(NonnullRawPtr);
|
||||||
|
AK_MAKE_DEFAULT_MOVABLE(NonnullRawPtr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ValueType = T;
|
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;
|
operator bool() const = delete;
|
||||||
bool operator!() const = delete;
|
bool operator!() const = delete;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue