Ok, complete pseudo code here.
template <typename T>
void fun(/*...*/)
{
some_meta_typelist pushback T;
}
So the idea is that at any point this function is instantiated it grows the some_meta_typelist object. If this is done across boundaries, is there any guarantee all calls to this template building mechanism will be compiled before the type list is used in maybe an MPL::fold function. When are these evaluated and when can you be sure they are done? Should this be limited to compilation units and never across .cpp boundaries? Is there an equivalent to calling a function with a static variable to ensure the object has been created before use?
Update
I'm looking at the idea that objects calling into a system will then build the typelist that system needs to do its work. My feeling is that the type list will depend entirely on the compilation order and so not be a valid approach beyond a single file CPP. I know MSVC compiles in alphabetical order, or at least it used to, so I could name the final file ZZZZ.cpp, by final I mean the one that needs the fully built typelist. This is not a safe or compatible solution. Is this the case? and is there a work around?
Thanks all