diff options
Diffstat (limited to 'modules/codec-json/tests')
-rw-r--r-- | modules/codec-json/tests/codec-json.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/codec-json/tests/codec-json.cpp b/modules/codec-json/tests/codec-json.cpp index c5f08ec..ab33f5a 100644 --- a/modules/codec-json/tests/codec-json.cpp +++ b/modules/codec-json/tests/codec-json.cpp @@ -378,6 +378,17 @@ SAW_TEST("Struct Array Struct read and write"){ native.template get<"banana">() = {4u}; data<schema::TestStructArrayStruct, encode::Json> json; + /** + * Usually I would do something like this + { + auto& banana = native.template get<"banana">(); + { + banana.at(0).get<"foo">().set(5); + banana.at(0).get<"bar">().set("baz"); + } + } + * But this also works. + */ native.template get<"banana">().at(0).get<"foo">().set(5); native.template get<"banana">().at(0).get<"bar">().set("baz"); |