Is it possible to "pass" somehow a static initializer list at construction time to a container wrapper class that than in turn initializes its member?
struct bar {
bar(void * ptr): ptr(ptr) {}
void * ptr;
};
template<class T, int N>
struct foo
{
foo( args ) :store(args) {} // here the arg list should be passed
T store[N];
};
int main()
{
bar b[2]={NULL,NULL};
foo<bar,2> f(NULL,NULL); // This should be possible
}
Unfortunately I cannot use STL or Boost.
Let me just explain, if you doubt the usefulness of this. First, this is a very "cooked-down" setup. Explaining the whole setup is not adequate to post here nor would it help. Just imagine a case, where you have a nested expression template tree, you traverse it at compile-time and collect the involved objects and store them in a container wrapper like the above. If you have further question please ask.
Edited: The default constructor of T should not be called.