Hi Stefan, A Builder already acts like a pointer: You can copy it by value, and the copy manipulates the same underlying message.
If you just want to express the type "capnp::Builder or null", then I suggest using `kj::Maybe<capnp::Builder>`, which serves exactly this purpose. A `kj::Maybe<T>` can be assigned to any `T` or to `nullptr`. You can unpack a Maybe with `KJ_IF_MAYBE()`. Check out the comments in `kj/commen.h` and copious examples throughout the KJ and Cap'n Proto source code to learn more. -Kenton On Wed, Sep 4, 2019 at 11:10 AM Stefan Kaps <[email protected]> wrote: > Hi, > > i would like to use pointers to builders in my exporter, so I can pass > nullptr in case of "please simply do a check, but do not build > capnp-data". Is this possible at all? > > If not, are there any suggestions you have for me how to provide such > functionality? > > Thanks a lot in advance, > Stefan > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/capnproto/c4c89dfb-6700-406e-99bf-e5c01c89fddf%40googlegroups.com > <https://groups.google.com/d/msgid/capnproto/c4c89dfb-6700-406e-99bf-e5c01c89fddf%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/CAJouXQkPhxusFvfewZffKt85GuC7hgr0tT3316jmzSrC%2BuCdOA%40mail.gmail.com.
