mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
27478ec7d4
The following command was used to clang-format these files: clang-format-19 -i $(find . \ -not \( -path "./\.*" -prune \) \ -not \( -path "./Build/*" -prune \) \ -not \( -path "./Toolchain/*" -prune \) \ -type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/IntrusiveList.h>
|
|
|
|
namespace AK {
|
|
namespace Detail {
|
|
|
|
template<class T, typename Container, IntrusiveListNode<T, Container> T::* member>
|
|
class IntrusiveListRelaxedConst : public IntrusiveList<T, Container, member> {
|
|
AK_MAKE_NONCOPYABLE(IntrusiveListRelaxedConst);
|
|
AK_MAKE_NONMOVABLE(IntrusiveListRelaxedConst);
|
|
|
|
public:
|
|
using IntrusiveList<T, Container, member>::IntrusiveList;
|
|
|
|
using Iterator = typename IntrusiveList<T, Container, member>::Iterator;
|
|
|
|
Iterator begin() const { return const_cast<IntrusiveListRelaxedConst*>(this)->IntrusiveList<T, Container, member>::begin(); }
|
|
Iterator end() const { return Iterator {}; }
|
|
};
|
|
|
|
}
|
|
|
|
template<auto member>
|
|
using IntrusiveListRelaxedConst = Detail::IntrusiveListRelaxedConst<
|
|
decltype(Detail::ExtractIntrusiveListTypes::value(member)),
|
|
decltype(Detail::ExtractIntrusiveListTypes::container(member)),
|
|
member>;
|
|
|
|
}
|
|
|
|
#if USING_AK_GLOBALLY
|
|
using AK::IntrusiveListRelaxedConst;
|
|
#endif
|