Boost logo

Boost :

From: joel de guzman (joel_at_[hidden])
Date: 2001-05-25 08:33:22


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

PS> No, doesn't have to be virtual, doesn't have to be member at all.
        I avoid virtuals. I opt for compile time polymorphism. I only use
        a single virtual call in Rule<> because I have no other alternative
        (see Rule.Rationale in the Spirit doc)


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