summaryrefslogtreecommitdiff
path: root/AK/Concepts.h
AgeCommit message (Collapse)Author
2023-02-04AK: Add the `ConvertibleTo` conceptLucas CHOLLET
2023-02-02AK: Ensure string types are actually considered hash-compatibleTimothy Flynn
The AnyString concept is currently broken because it checks whether a StringView is constructible from a type T. The StringView constructors, however, only accept constant rvalue references - i.e. `T const&`. This also adds a test to ensure this continues to work.
2022-12-12AK: Introduce the `DerivedFrom` conceptLucas CHOLLET
2022-12-12AK: Introduce Indexable conceptkleines Filmröllchen
This was dearly missing and can be used in many existing templates.
2022-12-09Everywhere: Remove unnecessary AK and Detail namespace scopingMoustafa Raafat
2022-11-27AK: Export Details and Concepts into the AK namespaceTim Schumacher
AK internals like to use concepts and details without a fully qualified name, which usually works just fine because we make everything AK-related available to the unqualified namespace. However, this breaks as soon as we start not using `USING_AK_GLOBALLY`, due to those identifiers no longer being made available. Instead, we just export those into the `AK` namespace instead.
2022-11-26AK: Make it possible to not `using` AK classes into the global namespaceAndreas Kling
This patch adds the `USING_AK_GLOBALLY` macro which is enabled by default, but can be overridden by build flags. This is a step towards integrating Jakt and AK types.
2022-11-18AK: Add a concept for requiring that a function is fallibleTimothy Flynn
This ensures that the function may be wrapped with TRY() and MUST().
2022-04-20AK: Add a OneOfIgnoringCV conceptAli Mohammad Pur
Some functions want to ignore cv-qualifiers, and it's much easier to constrain the type through a concept than a separate requires clause on the function.
2022-03-28AK: Add a 'OneOf' conceptAli Mohammad Pur
Similar to 'SameAs', but for multiple types.
2022-02-23AK: Add the Fundamental conceptkleines Filmröllchen
2022-02-15AK: Add a 'SpecializationOf' conceptAli Mohammad Pur
The counterpart to the IsSpecializationOf<...> template.
2022-01-28AK: Introduce the ArrayLike conceptkleines Filmröllchen
The ArrayLike type concept focuses on array-like data accesses. This means the ability to randomly index, obtain size information, as well as being able to expose the storage pointer. The last two already have the standard APIs `size` and `data`, respectively. The ArrayLike concept should always be fulfilled by Vector, FixedArray and Array as the three main array-like types. C-style arrays themselves of course can't fulfil ArrayLike (which could be considered ironic), but as we don't use them much anyways this isn't a problem.
2022-01-27AK: Export the SameAs conceptTimothy Flynn
2021-12-15AK: Add the concept of hash-compatible typesHendiadyoin1
2021-12-15AK: Add a Concept for any String typeHendiadyoin1
2021-07-22AK: Add a concept for iterable containersAli Mohammad Pur
This concept describes a type with a begin()/end() pair that can function as an iterator, given the following criteria: - The return type of begin() is comparable with the return type of end(), and the comparison (with operator!=) yields a bool - The object returned from begin() can be pre-incremented - The iterator has an operator*() implementation
2021-07-04AK+LibIPC: Make all enums codableTimothy
If an enum has a supported underlying type we can provide encoding and decoding for the enum as well.
2021-06-24AK: Make C++ concepts support mandatory for compilersDaniel Bertalan
The latest GCC and Clang versions both support this, so we can freely use these in our code.
2021-05-16AK+Kernel+LibELF: Remove the need for `IteratorDecision::Continue`Nicholas Baron
By constraining two implementations, the compiler will select the best fitting one. All this will require is duplicating the implementation and simplifying for the `void` case. This constraining also informs both the caller and compiler by passing the callback parameter types as part of the constraint (e.g.: `IterationFunction<int>`). Some `for_each` functions in LibELF only take functions which return `void`. This is a minimal correctness check, as it removes one way for a function to incompletely do something. There seems to be a possible idiom where inside a lambda, a `return;` is the same as `continue;` in a for-loop.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-10AK+Everywhere: Make StdLibExtras templates less wrapper-yAnotherTest
This commit makes the user-facing StdLibExtras templates and utilities arguably more nice-looking by removing the need to reach into the wrapper structs generated by them to get the value/type needed. The C++ standard library had to invent `_v` and `_t` variants (likely because of backwards compat), but we don't need to cater to any codebase except our own, so might as well have good things for free. :^)
2021-03-28AK: Add Signed/Unsigned concepts.Michel Hermier
2021-03-28AK: Make Concepts.h and StdLibExtras.h properly alias their own sumbols.Michel Hermier
2021-03-27AK: Add complex number libraryCesar Torres
Useful for diverse algorithms. Also added some tests for it.
2020-12-05AK: Pull Is{Integral,FloatingPoint} into the global namespaceLinus Groh
2020-08-17AK: Add SFINAE fallback for AK C++ concepts use, for Coverity compilerBrian Gianforcaro
The Coverity compiler doesn't support C++2a yet, and thus doesn't even recognize concept keywords. To allow serenity to be built and analyzed on such compilers, add a fallback underdef to perform the same template restriction based on AK::EnableIf<..> meta programming. Note: Coverity does seem to (annoyingly) define __cpp_concepts, even though it doesn't support them, so we need to further check for __COVERITY__ explicitly.
2020-08-07AK: Remove unnecessary clang-format off comments.asynts
2020-08-06AK: Add Integral and FloatingPoint concepts.asynts