Boost logo

Boost :

From: Adrian Michel (michel_at_[hidden])
Date: 2003-06-09 01:03:24

This question may sound silly for you boost veterans, but here it is
nonetheless. As a general matter, I am interested in boost from a consumer
rather than contributor standpoint (at least for now) so my questions will
be very practical in nature.

I #included <gregorian\greg_date.hpp> and <gregorian\parsers.hpp> in my
code, and they indirectly #include <lexical_cast.hpp>. Here is the warning I
get from the compiler (I am using MS Visual C++ 6):

d:\documents and
: warning C4800: 'void *' : forcing value to bool 'true' or 'false'
(performance warning)
        d:\documents and
: while compiling class-template member function 'bool __thiscall
boost::detail::lexical_stream<int,class std::basic_string<char,struct
aits<char>,class std::allocator<char> > >::operator <<(const class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > &)'

and others like this

And here is the line that causes this warning. First off, it's not clear why
the return should be a bool, and if that was indeed the author's intention,
the conversion between the ( stream << input ) which normally should return
a stream&, and bool, does not seem to make sense (for one thing the return
will never be false).

bool operator<<(const Source &input)
  return stream << input;

Could somebody clarify this.

Best regards,

Adrian Michel

Boost list run by bdawes at, gregod at, cpdaniel at, john at