mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 04:44:11 +00:00
Clarify that FlatBuffers unions do not support scalars (#6416)
I mention that a common practice is to wrap the scalar value in a table or a struct. Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
@@ -211,9 +211,11 @@ If you have a need to distinguish between different FlatBuffers in a more
|
|||||||
open-ended way, for example for use as files, see the file identification
|
open-ended way, for example for use as files, see the file identification
|
||||||
feature below.
|
feature below.
|
||||||
|
|
||||||
There is an experimental support only in C++ for a vector of unions
|
There is an experimental support only in C++ for a vector of unions (and
|
||||||
(and types). In the example IDL file above, use [Any] to add a
|
types). In the example IDL file above, use [Any] to add a vector of Any to
|
||||||
vector of Any to Monster table.
|
Monster table. There is also experimental support for other types besides
|
||||||
|
tables in unions, in particular structs and strings. There's no direct support
|
||||||
|
for scalars in unions, but they can be wrapped in a struct at no space cost.
|
||||||
|
|
||||||
### Namespaces
|
### Namespaces
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user