G
Guest
Hi Folks,
in interface
template<typename T>
class A{
public:
...
template<T2>
T2 additup(const T2&, const T2&);
....
};
in implementation
not sure if this is correct
template<T>
template<T2>
T2 A<T>::additup(const T2& x, const T2& y){
return (x + y);
}
in main()
A<int> A1;
this initializes T...but i am not sure how to use T2
let T2 = std::list<int>::iterator
A1<std::list<int>::iterator> A2;
A2.additup( A2,A2);
not sure if this correct...
any help greatly appreciated
Barry
in interface
template<typename T>
class A{
public:
...
template<T2>
T2 additup(const T2&, const T2&);
....
};
in implementation
not sure if this is correct
template<T>
template<T2>
T2 A<T>::additup(const T2& x, const T2& y){
return (x + y);
}
in main()
A<int> A1;
this initializes T...but i am not sure how to use T2
let T2 = std::list<int>::iterator
A1<std::list<int>::iterator> A2;
A2.additup( A2,A2);
not sure if this correct...
any help greatly appreciated
Barry