forked from BigfootDev/flatbuffers
Introduce convenient implicit operator string_view (#8181)
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -31,6 +31,11 @@ struct String : public Vector<char> {
|
||||
flatbuffers::string_view string_view() const {
|
||||
return flatbuffers::string_view(c_str(), size());
|
||||
}
|
||||
|
||||
/* implicit */
|
||||
operator flatbuffers::string_view() const {
|
||||
return flatbuffers::string_view(c_str(), size());
|
||||
}
|
||||
#endif // FLATBUFFERS_HAS_STRING_VIEW
|
||||
// clang-format on
|
||||
|
||||
|
||||
Reference in New Issue
Block a user