A
Allen
For example, define vector class as following:
namespace blas {
template<class T> class vector {
....
inline vector<T> operator=()
{
vector<T> t(*this);
return t;
}
};
}
Now define two instances:
blas::vector<double> a;
a = ...;
blas::vector<std::complex<double>> b;
b = a;
When compile the codes, c++ compiler will tell operator = is not
overloaded for type std::complex.
How to solve it?
Thank you very much.
Allen
namespace blas {
template<class T> class vector {
....
inline vector<T> operator=()
{
vector<T> t(*this);
return t;
}
};
}
Now define two instances:
blas::vector<double> a;
a = ...;
blas::vector<std::complex<double>> b;
b = a;
When compile the codes, c++ compiler will tell operator = is not
overloaded for type std::complex.
How to solve it?
Thank you very much.
Allen