Hi Frank,
I think you want something like:
auto outer = name.initNestedList(vec.size());
for (uint i = 0; i < vec.size(); i++) {
auto inner = outer.init(i, vec[i].size());
for (uint j = 0; j < vec[i].size(); j++) {
inner.set(j, vec[i][j]);
}
}
-Kenton
On Tue, Feb 20, 2018 at 3:04 PM, 'Frank' via Cap'n Proto <
[email protected]> wrote:
> Hi,
>
>
> I use Capnproto to serialise data. What is the best way to fill
> nestedList and list from std::vector<std::vector<bool>> resp.
> std::vector<bool>? For list I used initList() and the set() method in a
> loop but I am not sure how to proceed with nestedList. Do I have to
> create kj::Arrays for the nested lists?
>
> --
> struct Name {
> nestedList @0 :List(List(Bool));
> list @1 :List(Bool);
> }
> --
>
>
> Best,
>
> Frank
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at https://groups.google.com/group/capnproto.
>
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.