mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47: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
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue