I have a pretty simple array class, based on the vector class:
class myarray{
private:
vector<double> data_;
int size_;
public:
/// Constructor that allocates the memory
myarray(const int& nx): size_(nx) {
data_.resize(size_);
}
blah, blah, blah...
I want the user to be able to assign each element of myarray individually. For example, after declaring the object
myarray A(10);
I want the user to be able to do the following:
A(0) = 1;
A(1) = 2;
and etc. How do I do this?