Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-09 15:48:42


Matthew Vogt wrote:
> Rob Stewart wrote:

>>> I guess it looks okay with c.value(). What do you think?

>> I don't like it.

>> That's the right approach: just code in terms of good(c). You
>> get simplified code without the oddity of asking a
>> basic_character for its character. The real value in the
>> suggestion is that one should ignore fail() and eof()
>> conditions in the filter. That's something you can document and
>> your examples can show the simplified form.

> But the 'simplified' form will have (c = get(src) && c.good())
> everywhere, and the abstraction of algorithm state will result in
> more convoluted boolean expressions where testing 'good' will be very
> easy to omit...

 The idiom would be:

      if (good(c = get(src))) {
        ...
     }

Jonathan


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