Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7964: 'boost::system::error_code::unspecified_bool_type' : forcing value to bool 'true' or 'false' (performance warning)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-03 19:07:04
#7964: 'boost::system::error_code::unspecified_bool_type' : forcing value to bool
'true' or 'false' (performance warning)
--------------------------------------+-------------------------------------
Reporter: szx <szx@â¦> | Owner: bemandawes
Type: Bugs | Status: new
Milestone: To Be Determined | Component: system
Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------
Comment (by szx <szx@â¦>):
Strangely enough it seems to only appear in lambda functions because this
code compiles without warnings:
#include <boost/system/error_code.hpp>
void f(const boost::system::error_code &error) {
if (error) {}
}
int main() {
f(boost::system::error_code());
}
while the following one
#include <boost/system/error_code.hpp>
int main() {
auto lambda = [](const boost::system::error_code &error) {
if (error) {}
};
}
results in
test.cpp(6): warning C4800:
'boost::system::error_code::unspecified_bool_type' : forcing value to bool
'true' or 'false' (performance warning)
It's probably a compiler bug then I would guess.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7964#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC