mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
8639d8bc21
commit
d26aabff04
140 changed files with 1202 additions and 723 deletions
|
@ -56,7 +56,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
ALWAYS_INLINE NonnullRefPtr(U const& object) requires(IsConvertible<U*, T*>)
|
||||
ALWAYS_INLINE NonnullRefPtr(U const& object)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
: m_ptr(const_cast<T*>(static_cast<T const*>(&object)))
|
||||
{
|
||||
m_ptr->ref();
|
||||
|
@ -73,7 +74,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr<U>&& other) requires(IsConvertible<U*, T*>)
|
||||
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr<U>&& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
: m_ptr(static_cast<T*>(&other.leak_ref()))
|
||||
{
|
||||
}
|
||||
|
@ -85,7 +87,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
|
||||
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr<U> const& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
: m_ptr(const_cast<T*>(static_cast<T const*>(other.ptr())))
|
||||
{
|
||||
m_ptr->ref();
|
||||
|
@ -120,7 +123,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
NonnullRefPtr& operator=(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
|
||||
NonnullRefPtr& operator=(NonnullRefPtr<U> const& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
{
|
||||
NonnullRefPtr tmp { other };
|
||||
swap(tmp);
|
||||
|
@ -135,7 +139,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
NonnullRefPtr& operator=(NonnullRefPtr<U>&& other) requires(IsConvertible<U*, T*>)
|
||||
NonnullRefPtr& operator=(NonnullRefPtr<U>&& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
{
|
||||
NonnullRefPtr tmp { move(other) };
|
||||
swap(tmp);
|
||||
|
@ -190,7 +195,8 @@ public:
|
|||
}
|
||||
|
||||
template<typename U>
|
||||
void swap(NonnullRefPtr<U>& other) requires(IsConvertible<U*, T*>)
|
||||
void swap(NonnullRefPtr<U>& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
{
|
||||
AK::swap(m_ptr, other.m_ptr);
|
||||
}
|
||||
|
@ -198,7 +204,11 @@ public:
|
|||
bool operator==(NonnullRefPtr const& other) const { return m_ptr == other.m_ptr; }
|
||||
|
||||
template<typename RawPtr>
|
||||
bool operator==(RawPtr other) const requires(IsPointer<RawPtr>) { return m_ptr == other; }
|
||||
bool operator==(RawPtr other) const
|
||||
requires(IsPointer<RawPtr>)
|
||||
{
|
||||
return m_ptr == other;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
private:
|
||||
|
@ -229,7 +239,8 @@ struct Formatter<NonnullRefPtr<T>> : Formatter<T const*> {
|
|||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b) requires(IsConvertible<U*, T*>)
|
||||
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue