mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-07 20:59:10 +00:00
Introduce convenient implicit operator string_view (#8181)
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
co-authored by
Derek Bailey
parent
0e1305c8e2
commit
dd79eed495
@@ -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