Hi,
I want to generate the following type
R1::mth1_ > >
from mpl::vector, mpl::pair, C and mth1_?
I have started with this
template
struct generator {
typedef ??? type;
};
but I don't know what MTH'can be, because we have 3 different mth1_.
So I have reached to make a specific mth1_generator (for the specific symbol 'mth1_')
template
struct mth1_generator {
typedef ??? type; // The details of the type are ommited using 'mth1'
};
satisfying mth1_generate, mpl::pair, C>::type is equal to R1::mth1_ > > ?
As aal the mthX_generator follow the same structure, I have defined a macro DEFINE_GENERATOR which will define the specific generator for a symbol MTH
#define DEFINE_GENERATOR(MTH) \
template
struct MTH##_generator {
typedef ??? type; // The details of the type are ommited suing now MTH.
}
So the user will just have to do
DEFINE_GENERATOR(mth1);
Can I do it in a simpler way using some kind of traits or this is an inherent preprocessor problem?
Thanks for clarifications,
_____________________
Vicente Juan Botet Escribá