mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
Everywhere: Use C++ concepts instead of requires clauses
This commit is contained in:
parent
9721da2e6a
commit
ae2abcebbb
17 changed files with 60 additions and 61 deletions
|
@ -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)))
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue