I want to write a macro which, when expanded within a class, uses that class type (specifically, as template argument). Within class method, I can use this:
#define METHOD_MACRO int sample_method(void)const {\
return template_struct<this_type<decltype(this)>::type>::index;}
(this_type is my struct, here it's equivalent to remove_pointer<remove_const<T>>
)
But when I need class type outside of method (for typedef for class member pointer), this
keyword isn't available; I've tried to use auto
for some trick with deducing type, but no luck here.
Classes in question are inherited from my class, if this can be of any help. I would like to avoid anyone using my macro having to write obligatory typdedef
.
Any ideas?