
Hello,
I have a .cpp file which a sort of top level driver.
I have say 100 different
struct param_i {...};
where 1<=i<=100
Each param_i is defined in a param_i.hpp and param_i.cpp invokes metafunctions to obtain
typedef fusion< variant< vector<double>, triplet<double>, pair<double>, double>,
variant<...>, ...,
variant<...> >
seq_i_t;
this sequence type is visible only in the param_i.cpp, not the header file. Generation of this sequence is
The size of these sequences = number of members of param_i.
The toplevel driver and other .cpp need to move instances of these types around to other .cpp.
To avoid having the compiler call the metafunctions for these middle translation units, but only at the generating .cpp and at the consuming .cpp, I created a tag
struct fusion_seq_tag {};
typedef <typename Arg>
struct make_fusion_seq_i {
typedef <undefined> type;
};
typedef <typename Arg>
struct make_fusion_seq_tag {
typedef typename make_fusion_seq_i<Arg>::type base_type;
struct type : fusion_seq_tag, base_type {
type(...) : base_type(...) {}
};
};
return smart_ptr