So I installed the November CTP compiler for VS2012 express edition to play around with some of the new C++11 features and across an interesting bug. The code:
template <typename T, typename Alloc> template <typename... TArgs>
typename List<T,Alloc>::Node* List<T,Alloc>::AllocateNode (TArgs&&... args) {
uint64_t m;
Node* n = Allocate<Node>(1,m);
try { new (n) Node(std::forward<TArgs>(args)...); }
catch (...) { Deallocate(n); throw; }
return n;
}
Gives an "error C3546: '...' : there are no parameter packs available to expand" error at the catch(...) line. Apparently this is a known bug with the CTP as catch(...) statements can't be used with variadic templates. Fair enough that's why its a 'CTP'.
The question is, can anyone think of a workaround to this?