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