mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
c2a900b853
These instances were detected by searching for files that include AK/StdLibExtras.h, but don't match the regex: \\b(abs|AK_REPLACED_STD_NAMESPACE|array_size|ceil_div|clamp|exchange|for ward|is_constant_evaluated|is_power_of_two|max|min|mix|move|_RawPtr|RawP tr|round_up_to_power_of_two|swap|to_underlying)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use any "extra stdlib" functions. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
41 lines
914 B
C++
41 lines
914 B
C++
/*
|
|
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
|
|
namespace PDF {
|
|
|
|
class Document;
|
|
class Object;
|
|
|
|
#define ENUMERATE_OBJECT_TYPES(V) \
|
|
V(StringObject, string) \
|
|
V(NameObject, name) \
|
|
V(ArrayObject, array) \
|
|
V(DictObject, dict) \
|
|
V(StreamObject, stream) \
|
|
V(IndirectValue, indirect_value)
|
|
|
|
#define FORWARD_DECL(class_name, _) class class_name;
|
|
ENUMERATE_OBJECT_TYPES(FORWARD_DECL)
|
|
#undef FORWARD_DECL
|
|
|
|
template<typename T>
|
|
concept IsObject = IsBaseOf<Object, T>;
|
|
|
|
template<typename T>
|
|
concept IsValuePrimitive = IsSame<T, bool> || IsSame<T, int> || IsSame<T, float>;
|
|
|
|
template<typename T>
|
|
concept IsValueType = IsValuePrimitive<T> || IsObject<T>;
|
|
|
|
template<IsValueType T>
|
|
using UnwrappedValueType = Conditional<IsObject<T>, NonnullRefPtr<T>, T>;
|
|
|
|
}
|