mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
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:
@@ -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"); }
|
||||
|
||||
Reference in New Issue
Block a user