I get no matching member function error when i try to compile this code on my mingw32 compiler
#include <iostream>
using std::cout;
template <class T>
class Pattern
{
public:
Pattern(): element(){
cout<< "default c-tor";
}
Pattern(Pattern ©): element(copy.element){
cout<< "copy c-tor";
}
Pattern& operator=(Pattern &assgn)
{
cout<<" assignment operator";
element = assgn.element;
return *this;
}
~Pattern(){
cout<<"destructor";
}
private:
T element;
};
template <class T>
Pattern<T> creator()
{
cout<< "Testing creator";
Pattern<T> pat;
return pat;
}
int main()
{
Pattern<double> pt1(creator<double>());
Pattern<double> pt2 = creator<double>();
}
Somebody please tell me how to solve the problem.