P
P
pixik2015-12-29 09:21:33
C++ / C#
pixik, 2015-12-29 09:21:33

How to understand such a construction?

Everything is in code.

UWORD32 BitString::getValue (unsigned long s, unsigned short l) const
{
  myassert (l <= 32) ;
  UWORD32 retval = 0 ;
  for (unsigned short i = 0 ; i < l ; i++) {
    retval |= (*this)[s + i] << i ; // Как истолковать конструкцию (*this)[s + i] ?
  }
  return retval ;
}

/**                                             
 * get the value of the i-th bit                
 **/                                            
BIT operator[] (const unsigned long i) const ;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2015-12-29
@pixik

The BitString class is apparently derived from some class with the [] operator (or contains such an operator itself).
This thing is a command - "take yourself and call the operator []" on yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question