class Q
{
Q(const Q &obj) {} // copy constructor
Q& operator= (const Q& a){} // equal op overload
}
template <class T>
class B{
public : T x;
B<T>(T t) {
// x = t; }
}
int main()
{
Q a(2);
a.init(1,0);
a.init(2,1);
B <Q> aa(a); // this line gives error
}
How to initialize template class with copy constructor? B aa(a); // this line gives error I want to solve it but I could not. Error:
no matching function for call to 'Q::Q()'| candidate: Q::Q(const Q&)|
candidate expects 1 argument, 0 provided| candidate: Q::Q(int)|
candidate expects 1 argument, 0 provided|