mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
AK: Move String::number entirely to header file
Use SFINAE to enforce the fact that it's supposed to only be called for Arithmetic types, rather than counting on the linker to tell us that an instantiation of String::number(my_arg) was not found. This also adds String::number for floating point types as a side-effect.
This commit is contained in:
parent
b4eb734204
commit
0c51778510
2 changed files with 2 additions and 17 deletions
|
@ -239,21 +239,6 @@ template Optional<u16> String::to_uint() const;
|
|||
template Optional<u32> String::to_uint() const;
|
||||
template Optional<u64> String::to_uint() const;
|
||||
|
||||
template<typename T>
|
||||
String String::number(T value) { return formatted("{}", value); }
|
||||
|
||||
template String String::number(unsigned char);
|
||||
template String String::number(unsigned short);
|
||||
template String String::number(unsigned int);
|
||||
template String String::number(unsigned long);
|
||||
template String String::number(unsigned long long);
|
||||
template String String::number(char);
|
||||
template String String::number(short);
|
||||
template String String::number(int);
|
||||
template String String::number(long);
|
||||
template String String::number(long long);
|
||||
template String String::number(signed char);
|
||||
|
||||
String String::format(const char* fmt, ...)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue