Skip to content

Commit 293e112

Browse files
use cpp over macro
1 parent 413aaab commit 293e112

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc/src/__support/CPP/string_view.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_CPP_STRING_VIEW_H
1010
#define LLVM_LIBC_SRC___SUPPORT_CPP_STRING_VIEW_H
1111

12+
#include "limits.h"
1213
#include "src/__support/common.h"
1314
#include "src/__support/macros/config.h"
1415

@@ -61,7 +62,7 @@ class string_view {
6162

6263
// special value equal to the maximum value representable by the type
6364
// size_type.
64-
LIBC_INLINE_VAR static constexpr size_t npos = SIZE_MAX;
65+
LIBC_INLINE_VAR static constexpr size_t npos = cpp::numeric_limits<size_t>::max();
6566

6667
LIBC_INLINE constexpr string_view() : Data(nullptr), Len(0) {}
6768

0 commit comments

Comments
 (0)