From eaa31dc11b94b1e3c23dcc0092b95c71d1ab3afe Mon Sep 17 00:00:00 2001 From: Simon Richter Date: Wed, 6 Dec 2017 03:42:36 +0100 Subject: [PATCH] Avoid initialization from non-constexpr In-class initializers for "static const" class members must be constexpr, however std::string is only "static const" itself and cannot be used without compiler extensions. --- include/utf8.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/utf8.h b/include/utf8.h index 26c467f0d9..e78e8fd09e 100644 --- a/include/utf8.h +++ b/include/utf8.h @@ -145,7 +145,9 @@ public: return (UTF8&) *this; } - static const std::string::size_type npos = std::string::npos; + // std::string::npos is not constexpr, so we can't use it in an + // initializer. + static constexpr std::string::size_type npos = -1; UTF8& operator=( const wxString& o );