We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4053b8 commit 4292b73Copy full SHA for 4292b73
include/nonstd/string.hpp
@@ -281,13 +281,15 @@ namespace string {
281
282
// npos
283
284
-#if string_CPP17_OR_GREATER
285
- static string_constexpr std::size_t npos = std::size_t(-1);
+#if string_HAVE_STRING_VIEW
+ static string_constexpr std::size_t npos = std::string_view::npos;
286
+#elif string_CPP17_OR_GREATER
287
+ static string_constexpr std::size_t npos = std::string::npos;
288
#elif string_CPP11_OR_GREATER
- enum : std::size_t { npos = std::size_t(-1) };
289
+ enum : std::size_t { npos = std::string::npos };
290
#else
- enum { npos = std::size_t(-1) };
-#endif
291
+ enum { npos = std::string::npos };
292
+#endif // string_HAVE_STRING_VIEW
293
294
namespace detail {
295
0 commit comments