1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:07:46 +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

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Concepts.h>
#include <AK/Function.h>
#include <AK/QuickSort.h>
#include <LibEDID/EDID.h>
@ -165,16 +166,16 @@ T Parser::read_host(T const* field) const
return value;
}
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1)
template<Integral T>
requires(sizeof(T) > 1)
T Parser::read_le(T const* field) const
{
static_assert(sizeof(T) > 1);
return AK::convert_between_host_and_little_endian(read_host(field));
}
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1)
template<Integral T>
requires(sizeof(T) > 1)
T Parser::read_be(T const* field) const
{
static_assert(sizeof(T) > 1);

View file

@ -8,6 +8,7 @@
#include <AK/ByteBuffer.h>
#include <AK/ByteReader.h>
#include <AK/Concepts.h>
#include <AK/Endian.h>
#include <AK/Error.h>
#include <AK/FixedPoint.h>
@ -437,12 +438,12 @@ private:
template<typename T>
T read_host(T const*) const;
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1)
template<Integral T>
requires(sizeof(T) > 1)
T read_le(T const*) const;
template<typename T>
requires(IsIntegral<T> && sizeof(T) > 1)
template<Integral T>
requires(sizeof(T) > 1)
T read_be(T const*) const;
Definitions::EDID const& raw_edid() const;