|
Boost Users : |
From: Black Ice (yg-boost-users_at_[hidden])
Date: 2003-03-30 22:50:15
Thanks
-- /*******************/ ×ÔÓÉ£¨liberty£©Î޷ǾÍÊÇÕâÑùÒ»ÖÖ³Ðŵ£ºÃ¿¸öÈ˽«»áµÃµ½Ò»ÖÖ±£ÕÏ£¬±£ÕÏÎÒÃÇ¿ÉÒÔÓë ȨÍþ¡¢¶àÊý¡¢Á÷Ë×¼°ÓßÂÛµÄÓ°ÏìÏ࿹ºâ¡£ /*******************/ "Terje Sletteb?" <tslettebo_at_[hidden]> wrote in message news:03e401c2f598$0fe168e0$8d6c6f50_at_pc... > >From: "Black Ice" <yg-boost-users_at_[hidden]> > > > 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 > > > > Info: <http://www.boost.org> > Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> > Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]> > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ > > >
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net