Commit Graph

12 Commits

Author SHA1 Message Date
Timothy
e42484bb65 AK+LibIPC: Make all enums codable
If an enum has a supported underlying type we can provide encoding and
decoding for the enum as well.
2021-07-04 13:48:20 +04:30
Daniel Bertalan
985adcca38 AK: Make C++ concepts support mandatory for compilers
The latest GCC and Clang versions both support this, so we can freely
use these in our code.
2021-06-24 17:35:49 +04:30
Nicholas Baron
aa4d41fe2c
AK+Kernel+LibELF: Remove the need for IteratorDecision::Continue
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-05-16 10:36:52 +01:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-22 11:22:27 +02:00
AnotherTest
a6e4482080 AK+Everywhere: Make StdLibExtras templates less wrapper-y
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-04-10 21:01:31 +02:00
Michel Hermier
7d591432c4 AK: Add Signed/Unsigned concepts. 2021-03-28 11:45:51 +02:00
Michel Hermier
b8fac0a8b3 AK: Make Concepts.h and StdLibExtras.h properly alias their own sumbols. 2021-03-28 11:45:51 +02:00
Cesar Torres
f4f5a1c0e7 AK: Add complex number library
Useful for diverse algorithms.
Also added some tests for it.
2021-03-27 10:20:55 +01:00
Linus Groh
4dcd23c2be AK: Pull Is{Integral,FloatingPoint} into the global namespace 2020-12-05 23:52:17 +01:00
Brian Gianforcaro
ff0c7da75d AK: Add SFINAE fallback for AK C++ concepts use, for Coverity compiler
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-17 09:17:57 +02:00
asynts
3fb62e8c63 AK: Remove unnecessary clang-format off comments. 2020-08-07 15:57:51 +02:00
asynts
5f7427ba4b AK: Add Integral and FloatingPoint concepts. 2020-08-06 10:33:16 +02:00