29 Mar
2003
29 Mar
'03
2:08 a.m.
From: "Black Ice"
lexical_cast.hpp line 145: bool operator<<(const Source &input) { return stream << input; } Convert basic_stringstream & to bool?
Yes. :) basic_stringstream has a user-defined conversion to void *, which then converts to bool, giving the stream state. It has been suggested on the Boost list to change this to a more explicit test, though (also to remove a warning for this conversion), such as: bool operator<<(const Source &input) { return !(stream << input).fail(); } Regards, Terje