[ create a new paste ] login | about

Link: http://codepad.org/s5G0Cf6D    [ raw code | output | fork ]

C++, pasted on Feb 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
template<int R, int C, typename T> 
struct Vector {  
template <typename TRes>  TRes magnitude() const  {   return 0;  }  
};  

struct A {  
typedef Vector<3,1,int> NodeVector; 
};  

template<class T> struct B {  
void foo()  
{   
typename T::NodeVector x;   
x.magnitude<double>(); //< error here  
} 
}; 


Output:
1
2
3
t.cpp: In member function 'void B<T>::foo()':
Line 14: error: expected primary-expression before 'double'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: