The following program works with g++3.3. I'm assuming g++-3.4 is more
standard conforming that g++-3.3. Would you please tell me what is
right way to declare a template friend function of a template class?
Thanks,
Peng
#include <iostream>
template <typename T>
class A{
private:
A(){}
T _a;
public:
friend A *makeA<T>();//error in g++-3.4, works with g++3.3
};
template <typename T>
A<T> *makeA(){
return new A<T>;
}
int main ( void ) {
makeA<int>();
}