1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 16:37:47 +00:00

AK: Replace some SFINAE with requires clauses, clean up existing ones

Add requires clauses to constraints on InputStream and OutputStream
operator<< / operator>>. Make the constraint on String::number a
requires clause instead of SFINAE. Also, fix some unecessary IsSame in
Trie where specialized traits exist for the given use cases.
This commit is contained in:
Andrew Kaster 2020-12-30 04:59:14 -07:00 committed by Andreas Kling
parent 49a76164c8
commit 7d49ea9836
4 changed files with 40 additions and 29 deletions

View file

@ -252,8 +252,8 @@ public:
return vformatted(fmtstr, VariadicFormatParams { parameters... });
}
template<typename T, typename EnableIf<IsArithmetic<T>::value>::Type* = nullptr>
static String number(T value) { return formatted("{}", value); }
template<typename T>
static String number(T value) requires IsArithmetic<T>::value { return formatted("{}", value); }
StringView view() const;