|
Boost : |
From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-25 09:39:33
On Friday 25 May 2001 09:33 am, you wrote:
> From: "Larry Evans" :
> > joel de guzman wrote:
> > ...skipping
> >
> > > I'd like to be consistent. If we are to reuse | to mean alternative,
> > > what's wrong with reusing prefix + and *? Still I'd go for the
> > > iterator since it addresses something that the * and + couldn't do:
> > >
> > > repeat<8, 8>(a); // repeat 'a' exactly 8 times
> >
> > One more possibility:
> > a(8,8)
> > a(8)
> > which would require, I think, virtual methods:
> > Parser::operator()(int,int);
> > Parser::operator()(int);
>
> Greg Colvin suggested this too. I think this is cool!
>
> integer = digit[0, more];
> identifier = (uscore | alpha) >> (uscore | alpha | digit)[0, more];
>
> Yeah!
>
> Joel de Guzman
The bracket notation unfortunately can't be used for everything, because
digit[0, 2] == digit[2]
Doug
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk