mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17: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
20
AK/Stream.h
20
AK/Stream.h
|
@ -134,16 +134,14 @@ InputStream& operator>>(InputStream& stream, Optional<T>& value)
|
|||
return stream;
|
||||
}
|
||||
|
||||
template<typename Integral>
|
||||
InputStream& operator>>(InputStream& stream, Integral& value)
|
||||
requires IsIntegral<Integral>
|
||||
template<Integral I>
|
||||
InputStream& operator>>(InputStream& stream, I& value)
|
||||
{
|
||||
stream.read_or_error({ &value, sizeof(value) });
|
||||
return stream;
|
||||
}
|
||||
template<typename Integral>
|
||||
OutputStream& operator<<(OutputStream& stream, Integral value)
|
||||
requires IsIntegral<Integral>
|
||||
template<Integral I>
|
||||
OutputStream& operator<<(OutputStream& stream, I value)
|
||||
{
|
||||
stream.write_or_error({ &value, sizeof(value) });
|
||||
return stream;
|
||||
|
@ -151,16 +149,14 @@ requires IsIntegral<Integral>
|
|||
|
||||
#ifndef KERNEL
|
||||
|
||||
template<typename FloatingPoint>
|
||||
InputStream& operator>>(InputStream& stream, FloatingPoint& value)
|
||||
requires IsFloatingPoint<FloatingPoint>
|
||||
template<FloatingPoint F>
|
||||
InputStream& operator>>(InputStream& stream, F& value)
|
||||
{
|
||||
stream.read_or_error({ &value, sizeof(value) });
|
||||
return stream;
|
||||
}
|
||||
template<typename FloatingPoint>
|
||||
OutputStream& operator<<(OutputStream& stream, FloatingPoint value)
|
||||
requires IsFloatingPoint<FloatingPoint>
|
||||
template<FloatingPoint F>
|
||||
OutputStream& operator<<(OutputStream& stream, F value)
|
||||
{
|
||||
stream.write_or_error({ &value, sizeof(value) });
|
||||
return stream;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue