diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-13 00:04:42 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-13 00:04:48 +0200 |
commit | 00143afc01dbca797471181105738042e89f15ae (patch) | |
tree | d2b3fa92ed5d17ae5a145758bed637f996cbd501 /deimos/core/format.h | |
parent | 8db26a7350aad53ed73a127f9b8eb6ef15bf0be1 (diff) |
Use string view everywhere
Diffstat (limited to 'deimos/core/format.h')
-rw-r--r-- | deimos/core/format.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/deimos/core/format.h b/deimos/core/format.h index be2e4bf..3424dc2 100644 --- a/deimos/core/format.h +++ b/deimos/core/format.h @@ -22,9 +22,7 @@ struct FormatArg {
int64_t integer;
uint64_t unsigned_integer;
-
- // @Todo Use string views
- Span<const char> string;
+ StringView string;
};
explicit FormatArg(std::signed_integral auto value) :
@@ -37,15 +35,10 @@ struct FormatArg unsigned_integer{value}
{}
- explicit FormatArg(Span<const char> value) :
+ explicit FormatArg(StringView value) :
type{kString},
string{value}
{}
-
- explicit FormatArg(gsl::czstring value) :
- type{kString},
- string{value, (int64_t)__builtin_strlen(value)}
- {}
};
template<typename T>
|