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.
This commit is contained in:
Simon Richter 2017-12-06 03:42:36 +01:00 committed by Wayne Stambaugh
parent 2f8e60352b
commit eaa31dc11b
1 changed files with 3 additions and 1 deletions

View File

@ -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 );