[Tuxcpprogramming] Re: [LC++] Accessing operator[] within a class

Jean-Daniel PAUGET jd at univ-lyon1.fr
Tue Jul 10 02:58:48 UTC 2001


On Mon, 9 Jul 2001, Mark Phillips wrote:


another way that I use very often is like this:

class myVector: public vector<int> {
  int table(int row, int col) const {
    return operator[](row*10+col);
  }



> > For some reason, I can't send messages to the mailing list, but since no one
> > else has replied on list, have you tried:
> > return (*this)[row*10+col];
> >
> > good luck,
> > Andy
> >
> > > class myVector: public vector<int> {
> > >   int table(int row, int col) const {
> > >     return [row*10+col];
> > >   }

-- 
   (°-  --il n'y a pas d'helice, helas !            )\._.,--....,'``. 
   //\          et oui ! c'est la qu'est l'os !--  /,   _.. \   _\  ;`._ ,.
   v_/_        (the big vadrouille, 1944)         `._.-(,_..'--(,_..'`-.;.'




More information about the tuxCPProgramming mailing list