updated protobuf to 3.18.1
This commit is contained in:
@@ -148,6 +148,10 @@
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
#if defined(__cpp_lib_string_view)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/stubs/hash.h>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
@@ -215,6 +219,14 @@ class PROTOBUF_EXPORT StringPiece {
|
||||
length_ = CheckSize(str.size());
|
||||
}
|
||||
|
||||
#if defined(__cpp_lib_string_view)
|
||||
StringPiece( // NOLINT(runtime/explicit)
|
||||
std::string_view str)
|
||||
: ptr_(str.data()), length_(0) {
|
||||
length_ = CheckSize(str.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
StringPiece(const char* offset, size_type len)
|
||||
: ptr_(offset), length_(CheckSize(len)) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user