I have many classes displaying an internal type called Binding . For example, one of them may be:
struct Message { struct Binding { }; };
I call the apply function as follows:
apply< Message >([](Message::Binding& x) {
I wrote
template <class TMessage, class TBindingExpression> void apply(const TBindingExpression& expr) { typedef typename TMessage::Binding BindingType; BindingType binding; expr(binding); apply(MessageUtil::typeId< TMessage >(), binding); }
Since Message bit redundant in the way I invoke apply , I would like to draw the output of the Message compiler so that I can write
apply([](Message::Binding x) {
So far, I'm stuck here:
template <class TBindingExpression> void apply(const TBindingExpression& expr) {
Is there any way to write / achieve a MessageTypeFromBinding ?
Obviously, this is purely curiosity and cosmetic problems.
c ++ templates metaprogramming
mister why
source share