Every reference on google only shows easy examples, I have this case on a code:
#define XHANDLER(A,B,H) X_TO_BUS_HANDLER(A,B,H) X_FROM_BUS_HANDLER(A,B,H)
namespace{
X_TO_BUS_HANDLER( some::SomeClassX,
bus::SomeBus,
foo::SomeHandler );
Does any one know how this define works? One pattern and two token-lists? References please.
I egrepED the code but only found X_TO_BUS_HANDLER been used.
It works like any other define - whenever the preprocessor encounters XHANDLER
, it replaces it with X_TO_BUS_HANDLER(A,B,H) X_FROM_BUS_HANDLER(A,B,H)
(and parameters).
In your snippet, the macro isn't used.
But something like
XHANDLER(some::SomeClassX, bus::SomeBus, foo::SomeHandler)
would be equivalent to
X_TO_BUS_HANDLER(some::SomeClassX, bus::SomeBus, foo::SomeHandler) X_FROM_BUS_HANDLER(some::SomeClassX, bus::SomeBus, foo::SomeHandler)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With