|
Boost : |
From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-05-25 19:21:26
OK, I'm convinced.
From: joel de guzman <joel_at_[hidden]>
> From: "joel de guzman" <joel_at_[hidden]>
>
> > From: "Greg Colvin" > >
> > > > JDG: How about something like:
> > > >
> > > > class More_ {} more;
> > > >
> > > > IteratedParser Parser::operator () (uint first);
> > > > IteratedParser Parser::operator () (uint first, uint last);
> > > > IteratedParser Parser::operator () (uint first, More_ last);
> > >
> > > That works too, but how is it really better than
> > >
> > > const int more = -1;
> > > IteratedParser Parser::operator () (int first);
> > > IteratedParser Parser::operator () (int first, int last);
> > >
> >
> > Yes. Taking int parameters require an additional assert
> > for invalid (negative) numbers apart from -1 for the
> > second arg. uint parameters do not require checking
> > for negative numbers.
> >
> > Cheers,
> > Joel de Guzman
>
> Furthermore, the first 2 functions do *finite* iteration
> automatically without further checks for special cases.
>
> > > > IteratedParser Parser::operator () (uint first);
> > > > IteratedParser Parser::operator () (uint first, uint last);
>
> The third always does *infinite* iteration.
>
> > > > IteratedParser Parser::operator () (uint first, More_ last);
>
> Cheers,
> Joel de Guzman
>
>
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk