i am learning C++ and i made a complex<T> class.
I made a copy constructor from complex<T2> to complex<T1>,
I have also made a:
template< class T > operator+(const complex<T>& a, const complex<T>& b)
if a write:
Expand|Select|Wrap|Line Numbers
- complex<float> f;
- complex<double> d;
- f + d;
I have also made a copy assignment for a different type T:
Expand|Select|Wrap|Line Numbers
- template< class T2> complex& operator=(const complex<T2>& c){
- if (this != &c){ <<---- HERE I GET THE ERROR
- ....
- }
- return *this;
- }