Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-05-25 18:25:06


From: joel de guzman <joel_at_[hidden]>
> From: "Douglas Gregor":
> >
> > The bracket notation unfortunately can't be used for everything, because
> > digit[0, 2] == digit[2]
> >
>
> [] can't have 2 parameters. Is that what you mean?
>
> can't have:
>
> struct X {
> int operator [] (int, int);
> };
>
> So we're left with the () op.
>
> ... Right....
>
> Seigh, I kinda liked [] for iteration to distinguish from
> grouping ex:
>
> (a | b | c)[0, more];
>
> instead of
>
> (a | b | c)(0, more);
>
> Oh well...

A verbose but clear alternative is

   (a | b | c).repeat(0, more)


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