Boost logo

Boost :

From: joel de guzman (joel_at_[hidden])
Date: 2001-05-25 19:12:36


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


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