[capnproto] Best practice for dynamic_cast equivalent method for extended interfaces

2022-10-07 Thread Christophe Alexandre
Hi, Sorry for the newbie question. I've read the following thread and this is related to the same kind of question. https://groups.google.com/g/capnproto/c/XLo5RPLpVBg/m/LI_sGi72AgAJ With following schema example: interface Abstract {} interface ConcreteA extends(Abstract) {} interface Concret

Re: [capnproto] Best practice for dynamic_cast equivalent method for extended interfaces

2022-10-07 Thread 'Kenton Varda' via Cap'n Proto
Hi Christophe, There is no built-in mechanism for this. Instead, you have to build this into your interface. Note that a `Client` object can be "safely" cast to any type using `client.castAs()`. I say "safely" meaning: you won't violate C++ memory safety by this cast, even if the server doesn't a