
19 Nov
2008
19 Nov
'08
10:02 a.m.
On Wed, Nov 19, 2008 at 3:18 AM, vicente.botet <vicente.botet@wanadoo.fr>wrote:
Hi,
I want to create an static task_array<n> which must be initiaized with n functors.
In pseudo code:
template <std::size N> struct task_array { template <typename F_1, ..., typename F_N> task_array(F_1 f1, ..., F_N fN); };
You could use a normal variadic template constructor with a static_assert in it. If that's not good enough (i.e. you need to remove the constructor from the overload set) I would suggest enable_if, but I can't think of a way to get it into the constructor. With concepts you could do requires std::True<sizeof...(T) == N> Yechezkel Mett