mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Make const_strlen
return an unsigned value
This commit is contained in:
parent
552c7bc40b
commit
ef5db47cf7
1 changed files with 1 additions and 1 deletions
|
@ -732,7 +732,7 @@ static_assert(const_strcmp("b", "aa") > 0, "const_strcmp failure");
|
|||
|
||||
/// Compile-time agnostic-size strlen/wcslen implementation. Unicode-unaware.
|
||||
template <typename T>
|
||||
constexpr ssize_t const_strlen(const T *str) {
|
||||
constexpr size_t const_strlen(const T *str) {
|
||||
return *str == static_cast<T>(0) ? 0 : 1 + const_strlen(str + 1);
|
||||
}
|
||||
static_assert(const_strlen("") == 0, "const_strlen failure");
|
||||
|
|
Loading…
Reference in a new issue