Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-09 16:36:23


Matthew Vogt wrote:
> Jonathan Turkanis wrote:
>>> if (c = boost::io::get(src))
>>> {
>>> // c is not EOF or EAGAIN
>>> if (c == comment_char_)
>>
>>
>> if (c.value() == comment_char_)
>>
>>
>>> {
>>> in_comment_ = true;
>>> return this->get(src);
>>> }
>>> }
>>> return c;
>>> }
>>> }
>>
>>
>> I guess it looks okay with c.value(). What do you think?
>>
>
> Can the character class have operator==(char), or does this need to
> be a template?

To support both the implicit conversion to char and the safe bool conversion
we'd need to implement many more operators than operator==, and I think there
would still be problems with ambiguity.

Jonathan


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