Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualRyan_001

Posted 09 January 2013 - 12:30 PM

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?

#1Ryan_001

Posted 09 January 2013 - 11:37 AM

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?

PARTNERS