diff --git a/include/grpc++/support/string_ref.h b/include/grpc++/support/string_ref.h index a17e167d2bf1ed0f2fb3a0d4696314379ec0730b..9d965260ca34b260a7e7ddeff516d7124ddeea82 100644 --- a/include/grpc++/support/string_ref.h +++ b/include/grpc++/support/string_ref.h @@ -56,7 +56,7 @@ class string_ref { typedef std::reverse_iterator<const_iterator> const_reverse_iterator; // constants - const static size_t npos = size_t(-1); + const static size_t npos; // construct/copy. string_ref() : data_(nullptr), length_(0) {} diff --git a/src/cpp/util/string_ref.cc b/src/cpp/util/string_ref.cc index 604134fa9da9cfca538d61e5d091a25be48e0e49..66c79a1818431daa0b6719778c259dcd678fca80 100644 --- a/src/cpp/util/string_ref.cc +++ b/src/cpp/util/string_ref.cc @@ -40,7 +40,7 @@ namespace grpc { -const size_t string_ref::npos; +const size_t string_ref::npos = size_t(-1); string_ref& string_ref::operator=(const string_ref& rhs) { data_ = rhs.data_;