From 91a58fe669623c80c08a625002e47a1938457c40 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 5 Jul 2025 12:05:14 +0200 Subject: Adding possible diverge --- modules/codec-json/tests/codec-json.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/codec-json/tests') 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 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"); -- cgit v1.2.3