mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:57:36 +00:00
Everywhere: Remove 'clang-format off' comments that are no longer needed
This commit is contained in:
parent
c911781c21
commit
996c020b0d
6 changed files with 42 additions and 57 deletions
|
@ -43,20 +43,24 @@ static_assert(word_size == 32 || word_size == 64);
|
|||
constexpr size_t max_big_int_length = 1 << (word_size == 32 ? 26 : 29);
|
||||
|
||||
// ===== Static storage for big integers =====
|
||||
// FIXME: remove once Clang formats these properly.
|
||||
// clang-format off
|
||||
template<typename T, typename WordType = NativeWord>
|
||||
concept IntegerStorage = requires(T storage, size_t index)
|
||||
{
|
||||
{ storage.is_negative() } -> SameAs<bool>;
|
||||
{ storage.size() } -> SameAs<size_t>;
|
||||
{ storage[index] } -> ConvertibleTo<WordType&>;
|
||||
{ storage.data() } -> ConvertibleTo<WordType*>;
|
||||
concept IntegerStorage = requires(T storage, size_t index) {
|
||||
{
|
||||
storage.is_negative()
|
||||
} -> SameAs<bool>;
|
||||
{
|
||||
storage.size()
|
||||
} -> SameAs<size_t>;
|
||||
{
|
||||
storage[index]
|
||||
} -> ConvertibleTo<WordType&>;
|
||||
{
|
||||
storage.data()
|
||||
} -> ConvertibleTo<WordType*>;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
concept IntegerReadonlyStorage = IntegerStorage<T, NativeWord const>;
|
||||
// clang-format on
|
||||
|
||||
struct NullAllocator {
|
||||
NativeWord* allocate(size_t) { VERIFY_NOT_REACHED(); }
|
||||
|
|
|
@ -57,13 +57,9 @@ concept AnyString = IsConstructible<StringView, RemoveCVReference<T> const&>;
|
|||
template<typename T, typename U>
|
||||
concept HashCompatible = IsHashCompatible<Detail::Decay<T>, Detail::Decay<U>>;
|
||||
|
||||
// FIXME: remove once Clang formats these properly.
|
||||
// clang-format off
|
||||
|
||||
// Any indexable, sized, contiguous data structure.
|
||||
template<typename ArrayT, typename ContainedT, typename SizeT = size_t>
|
||||
concept ArrayLike = requires(ArrayT array, SizeT index)
|
||||
{
|
||||
concept ArrayLike = requires(ArrayT array, SizeT index) {
|
||||
{
|
||||
array[index]
|
||||
}
|
||||
|
@ -87,8 +83,7 @@ concept ArrayLike = requires(ArrayT array, SizeT index)
|
|||
|
||||
// Any indexable data structure.
|
||||
template<typename ArrayT, typename ContainedT, typename SizeT = size_t>
|
||||
concept Indexable = requires(ArrayT array, SizeT index)
|
||||
{
|
||||
concept Indexable = requires(ArrayT array, SizeT index) {
|
||||
{
|
||||
array[index]
|
||||
}
|
||||
|
@ -96,8 +91,7 @@ concept Indexable = requires(ArrayT array, SizeT index)
|
|||
};
|
||||
|
||||
template<typename Func, typename... Args>
|
||||
concept VoidFunction = requires(Func func, Args... args)
|
||||
{
|
||||
concept VoidFunction = requires(Func func, Args... args) {
|
||||
{
|
||||
func(args...)
|
||||
}
|
||||
|
@ -105,8 +99,7 @@ concept VoidFunction = requires(Func func, Args... args)
|
|||
};
|
||||
|
||||
template<typename Func, typename... Args>
|
||||
concept IteratorFunction = requires(Func func, Args... args)
|
||||
{
|
||||
concept IteratorFunction = requires(Func func, Args... args) {
|
||||
{
|
||||
func(args...)
|
||||
}
|
||||
|
@ -114,17 +107,19 @@ concept IteratorFunction = requires(Func func, Args... args)
|
|||
};
|
||||
|
||||
template<typename T, typename EndT>
|
||||
concept IteratorPairWith = requires(T it, EndT end)
|
||||
{
|
||||
concept IteratorPairWith = requires(T it, EndT end) {
|
||||
*it;
|
||||
{ it != end } -> SameAs<bool>;
|
||||
{
|
||||
it != end
|
||||
} -> SameAs<bool>;
|
||||
++it;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
concept IterableContainer = requires
|
||||
{
|
||||
{ declval<T>().begin() } -> IteratorPairWith<decltype(declval<T>().end())>;
|
||||
concept IterableContainer = requires {
|
||||
{
|
||||
declval<T>().begin()
|
||||
} -> IteratorPairWith<decltype(declval<T>().end())>;
|
||||
};
|
||||
|
||||
template<typename Func, typename... Args>
|
||||
|
@ -134,7 +129,6 @@ concept FallibleFunction = requires(Func&& func, Args&&... args) {
|
|||
func(forward<Args>(args)...).release_value();
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
#if !USING_AK_GLOBALLY
|
||||
|
|
|
@ -487,9 +487,7 @@ public:
|
|||
[[nodiscard]] i64 truncated_seconds() const { return m_offset.to_truncated_seconds(); }
|
||||
[[nodiscard]] i64 nanoseconds_within_second() const { return to_timespec().tv_nsec; }
|
||||
|
||||
// clang-format off
|
||||
constexpr bool operator==(MonotonicTime const& other) const { return this->m_offset == other.m_offset; }
|
||||
// clang-format on
|
||||
constexpr int operator<=>(MonotonicTime const& other) const { return this->m_offset <=> other.m_offset; }
|
||||
|
||||
constexpr MonotonicTime operator+(Duration const& other) const { return MonotonicTime { m_offset + other }; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue