diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-05 12:05:14 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-05 12:05:14 +0200 |
commit | 91a58fe669623c80c08a625002e47a1938457c40 (patch) | |
tree | 31c0d57b8fb46e2f7c0266313ba4740e087d8980 /modules/codec-json/tests | |
parent | b71f4791ce6d50d72f523aa9880228ab30ee2752 (diff) |
Adding possible diverge
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"); |