Add cpp_vec_type attribute for object API vector customization

Mirrors cpp_str_type and cpp_ptr_type: a per-field cpp_vec_type attribute
lets users substitute any std::vector-compatible container in generated
T-structs, and --cpp-vec-type sets the global default.

NativeVector() resolves the attribute (falling back to the global option,
then std::vector). Changes applied to GenTypeNative, GenMember, GenParam
(CreateDirect), and the CreateVectorOfStrings fast-path guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 19:55:26 +02:00
parent 9e9f5bbfcf
commit 35665b5ae7
8 changed files with 113 additions and 7 deletions

View File

@@ -383,6 +383,11 @@ flatc(
schema="native_type_test.fbs",
)
flatc(
["--cpp", "--gen-compare", "--gen-mutable", "--gen-object-api", "--reflect-names"],
schema="cpp_vec_type_test.fbs",
)
flatc(
[
"--cpp",