(Note: I posted a similar thread in StackOverflow but got no answers).
I am working on a code that is based on what comes with the Numerical Recipes (3rd ed.) book. The code defines a new vector class, called NRvector, for example VecDoub is a vector of doubles.
The error is in the =: error C2679: binary '=' : no operator found which takes a right-hand operand of type 'Doub'. But `spec` is a VecDoub, not Doub ??
For reference:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class NRvector {
private:
int nn; // size of array. upper index is nn-1
T *v;
public:
NRvector();
explicit NRvector(int n); // Zero-based array
NRvector(int n, const T &a); //initialize to constant value
NRvector(int n, const T *a); // Initialize to array
NRvector(const NRvector &rhs); // Copy constructor
NRvector & operator=(const NRvector &rhs); //assignment
...
~NRvector();
};
typedef NRvector<Doub> VecDoub, VecDoub_O, VecDoub_IO;