Possible Duplicate:
Convert std::tuple to std::array C++11
Suppose you have:
template<class T,int N>
struct A {
A(const B& b): /* what comes here */ {}
std::array<T,N> F;
};
I need each element of F[]
to be constructed with the argument of the constructor, in above case b
. This is tricky because the argument might not be of a type that can be a compile-time constant, like int
etc.
This is different to Is it possible to construct the elements of a member array depending on an integral template parameter? since here a user-defined struct is used and thus we need run-time copies of it.