diff --git a/include/flatbuffers/string.h b/include/flatbuffers/string.h index 97e399fd64a..00cc18c9a76 100644 --- a/include/flatbuffers/string.h +++ b/include/flatbuffers/string.h @@ -31,6 +31,11 @@ struct String : public Vector { 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