Forward Declare Template Alias

I have a template with an alias defined using the using directive:

template<typename A> using T=TC<decltype(A::b),decltype(A::c)>; 

Does C ++ 11 provide a mechanism for forwarding declarations of this T template alias?

I tried:

 template<typename> struct T; 

and

 template<typename> using T; 

but both return compiler errors ("conflict with previous declaration"). I am using gcc 4.8.

What is the syntax to make this work?

+7
source share
1 answer

No, It is Immpossible.

What you want to do is forward the TC announcement, and then determine T immediately below it.

 template<typename T, typename U> struct TC; template<typename A> using T=TC<decltype(A::b),decltype(A::c)>; 
+9
source

All Articles