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
commit 7d49ea9836
Notes: sideshowbarker 2024-07-19 00:23:30 +09:00
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;