I
imutate
How do you do assignment operator within a template ?
#include <vector>
template < typename T >
class Vec : public std::vector< T > {
public:
Vec() { }
Vec( int s ) : std::vector<T>(s) { }
T& operator[](int i) { return this -> at(i); }
const T& operator[](int i) const { return this -> at(i); }
T& operator=(const T& rhs) { return this -> // and then what, if
that is right atall ? }
};
#include <vector>
template < typename T >
class Vec : public std::vector< T > {
public:
Vec() { }
Vec( int s ) : std::vector<T>(s) { }
T& operator[](int i) { return this -> at(i); }
const T& operator[](int i) const { return this -> at(i); }
T& operator=(const T& rhs) { return this -> // and then what, if
that is right atall ? }
};