[LC++]STL-like vector, but with domain a ... (b-1)

Mark Phillips mark at austrics.com.au
Tue Jan 8 22:47:34 UTC 2002


Found the problem!!!

I made the following arithmetic error:

>     tn& operator[](int i) {return vecVt[i-originVt];}
>     tn const& operator[](int i) const {return vecVt[i-originVt];}

where I had "i-originVt" above, I should have had "i+originVt".

So it was nothing to do with copy constructors or assignment
operators!

(If anyone has any comments about improvements to my implementation
I would still be interested in hearing them.)

Cheers,

Mark.



More information about the tuxCPProgramming mailing list