diff options
author | Moustafa Raafat <MoustafaRaafat2@gmail.com> | 2022-11-14 18:20:59 +0000 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-09 11:25:30 +0000 |
commit | ae2abcebbbabf7ca8b806b5555c11cd0b216dbdb (patch) | |
tree | cef5406660d2e60fedda9dcd0839c8f88e0a2d93 /Userland/Libraries/LibCrypto/BigInt | |
parent | 9721da2e6ae2948319ae731b65073d1fe7200b4f (diff) | |
download | serenity-ae2abcebbbabf7ca8b806b5555c11cd0b216dbdb.zip |
Everywhere: Use C++ concepts instead of requires clauses
Diffstat (limited to 'Userland/Libraries/LibCrypto/BigInt')
-rw-r--r-- | Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h index 4a6667ebcb..92b8833891 100644 --- a/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -7,6 +7,7 @@ #pragma once +#include <AK/Concepts.h> #include <AK/Span.h> #include <LibCrypto/BigInt/UnsignedBigInteger.h> @@ -16,8 +17,8 @@ struct SignedDivisionResult; class SignedBigInteger { public: - template<typename T> - requires(IsSigned<T> && sizeof(T) <= sizeof(i32)) + template<Signed T> + requires(sizeof(T) <= sizeof(i32)) SignedBigInteger(T value) : m_sign(value < 0) , m_unsigned_data(abs(static_cast<i32>(value))) diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index 8fee84b9bf..c9a4c38021 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -9,6 +9,7 @@ #pragma once #include <AK/ByteBuffer.h> +#include <AK/Concepts.h> #include <AK/DeprecatedString.h> #include <AK/Span.h> #include <AK/Types.h> @@ -25,8 +26,8 @@ public: static constexpr size_t BITS_IN_WORD = 32; // This constructor accepts any unsigned with size up to Word. - template<typename T> - requires(IsIntegral<T> && sizeof(T) <= sizeof(Word)) + template<Integral T> + requires(sizeof(T) <= sizeof(Word)) UnsignedBigInteger(T value) { m_words.append(static_cast<Word>(value)); |