From 18bacd3ea54d9ec1da4754ac14560a721215b140 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Wed, 13 Apr 2022 14:13:32 -0700 Subject: [PATCH] Expand test to make sure {}-initializers are properly understood by template. (#7242) Since CreateVectorOfStrings() takes a templated container, make sure that the default template deduction from just an initializer list will still work. Signed-off-by: Henner Zeller --- tests/test.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test.cpp b/tests/test.cpp index 06d6a08fa..497f3dd18 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -149,6 +149,9 @@ flatbuffers::DetachedBuffer CreateFlatBufferTest(std::string &buffer) { builder.CreateVectorOfStrings(names4); // Also an accepted type #endif + // Make sure the template deduces an initializer as std::vector + builder.CreateVectorOfStrings({"hello", "world"}); + // Create many vectors of strings std::vector manyNames; for (auto i = 0; i < 100; i++) { manyNames.push_back("john_doe"); }