1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:57:47 +00:00

Everywhere: Use C++ concepts instead of requires clauses

This commit is contained in:
Moustafa Raafat 2022-11-14 18:20:59 +00:00 committed by Sam Atkins
parent 9721da2e6a
commit ae2abcebbb
17 changed files with 60 additions and 61 deletions

View file

@ -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)))

View file

@ -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));