Skip to content

Commit 3b40a54

Browse files
committed
[basic.string.general] Adjust declaration of basic_string::npos
Use constexpr and an explicit conversion to size_type, for consistency with basic_string_view.
1 parent 0181836 commit 3b40a54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/strings.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@
807807
using const_iterator = @\impdefx{type of \tcode{basic_string::const_iterator}}@; // see \ref{container.requirements}
808808
using reverse_iterator = std::reverse_iterator<iterator>;
809809
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
810-
static const size_type npos = -1;
810+
static constexpr size_type npos = size_type(-1);
811811

812812
// \ref{string.cons}, construct/copy/destroy
813813
constexpr basic_string() noexcept(noexcept(Allocator())) : basic_string(Allocator()) { }

0 commit comments

Comments
 (0)