Boost logo

Boost :

From: Ross Smith (ross.s_at_[hidden])
Date: 2001-05-25 18:53:43


joel de guzman wrote:
>
> ----- Original Message -----
> From: "Douglas Gregor" :
>
> > The bracket notation unfortunately can't be used for everything, because
> > digit[0, 2] == digit[2]
>
> Please elaborate...

There's no two-argument version of operator[]. The "0,2" in "digit[0,2]"
will be read as a comma operator (thus discarding the first operand),
not as two arguments to a function. To use more than one argument you
have to use parentheses; operator(), unlike operator[], can be
overloaded for any number of arguments.

-- 
Ross Smith <ross.s_at_[hidden]> The Internet Group, Auckland, New Zealand
========================================================================
        "Hungarian notation is the tactical nuclear weapon of
         source code obfuscation techniques." -- Roedy Green

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk