--
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 capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/c4c89dfb-6700-406e-99bf-e5c01c89fddf%40googlegroups.com.
extern "C" {
myT *refPtr( myT & );
};
mov rax, rcx
retHi 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 <st0f...@gmail.com> 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 capn...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/97f32335-e03f-45ba-8125-12a121af6df8%40googlegroups.com.
kj::Maybe()