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 <hzeller@google.com>
This commit is contained in:
Henner Zeller
2022-04-13 14:13:32 -07:00
committed by GitHub
parent a2c913aec3
commit 18bacd3ea5

View File

@@ -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<std::string>
builder.CreateVectorOfStrings({"hello", "world"});
// Create many vectors of strings
std::vector<std::string> manyNames;
for (auto i = 0; i < 100; i++) { manyNames.push_back("john_doe"); }