summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Cruz Viotti <jv@jviotti.com>2021-01-21 20:08:29 -0400
committerGitHub <noreply@github.com>2021-01-21 16:08:29 -0800
commit7b1ee31d808382fb8ad6213373c7213634601265 (patch)
tree540e1ef91ec3de53fc31c21dda3b53143daf3000
parent4aff1198dd72b4c79652d0c42fbb1dfa2e21afa9 (diff)
downloadflatbuffers-7b1ee31d808382fb8ad6213373c7213634601265.tar.gz
flatbuffers-7b1ee31d808382fb8ad6213373c7213634601265.tar.bz2
flatbuffers-7b1ee31d808382fb8ad6213373c7213634601265.zip
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>
-rw-r--r--docs/source/Schemas.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/source/Schemas.md b/docs/source/Schemas.md
index 06c0f5c2..af01a6a6 100644
--- a/docs/source/Schemas.md
+++ b/docs/source/Schemas.md
@@ -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
feature below.
-There is an experimental support only in C++ for a vector of unions
-(and types). In the example IDL file above, use [Any] to add a
-vector of Any to Monster table.
+There is an experimental support only in C++ for a vector of unions (and
+types). In the example IDL file above, use [Any] to add a vector of Any to
+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