Boost C++ Libraries: Ticket #6297: Warning under VC https://svn.boost.org/trac10/ticket/6297 <p> Warning text:<br /> c:\test\boost\boost\numeric\conversion\detail\converter.hpp(166) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) </p> <blockquote> <p> c:\test\boost\boost\numeric\conversion\detail\converter.hpp(165) : while compiling class template member function 'boost::numeric::range_check_result boost::numeric::convdetail::GT_HiT&lt;Traits&gt;::apply(bool)' with [ </p> <blockquote> <p> Traits=conv_traits </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\detail\converter.hpp(236) : see reference to class template instantiation 'boost::numeric::convdetail::GT_HiT&lt;Traits&gt;' being compiled with [ </p> <blockquote> <p> Traits=conv_traits </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\detail\converter.hpp(288) : see reference to class template instantiation 'boost::numeric::convdetail::combine&lt;PredA,PredB&gt;' being compiled with [ </p> <blockquote> <p> PredA=boost::numeric::convdetail::non_applicable, PredB=boost::numeric::convdetail::GT_HiT&lt;conv_traits&gt; </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\detail\converter.hpp(287) : while compiling class template member function 'boost::numeric::range_check_result boost::numeric::convdetail::generic_range_checker&lt;Traits,<a class="missing wiki">IsNegOverflow</a>,<a class="missing wiki">IsPosOverflow</a>,<a class="missing wiki">OverflowHandler</a>&gt;::out_of_range(bool)' with [ </p> <blockquote> <p> Traits=conv_traits, <a class="missing wiki">IsNegOverflow</a>=boost::numeric::convdetail::non_applicable, <a class="missing wiki">IsPosOverflow</a>=boost::numeric::convdetail::GT_HiT&lt;conv_traits&gt;, <a class="missing wiki">OverflowHandler</a>=boost::numeric::numeric_cast_traits&lt;int,bool&gt;::overflow_policy </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\detail\converter.hpp(508) : see reference to class template instantiation 'boost::numeric::convdetail::generic_range_checker&lt;Traits,<a class="missing wiki">IsNegOverflow</a>,<a class="missing wiki">IsPosOverflow</a>,<a class="missing wiki">OverflowHandler</a>&gt;' being compiled with [ </p> <blockquote> <p> Traits=conv_traits, <a class="missing wiki">IsNegOverflow</a>=boost::numeric::convdetail::non_applicable, <a class="missing wiki">IsPosOverflow</a>=boost::numeric::convdetail::GT_HiT&lt;conv_traits&gt;, <a class="missing wiki">OverflowHandler</a>=boost::numeric::numeric_cast_traits&lt;int,bool&gt;::overflow_policy </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\converter.hpp(35) : see reference to class template instantiation 'boost::numeric::convdetail::non_rounding_converter&lt;Traits,<a class="missing wiki">RangeChecker</a>,<a class="missing wiki">RawConverter</a>&gt;' being compiled with [ </p> <blockquote> <p> Traits=conv_traits, <a class="missing wiki">RangeChecker</a>=boost::numeric::convdetail::generic_range_checker&lt;conv_traits,boost::numeric::convdetail::non_applicable,boost::numeric::convdetail::GT_HiT&lt;conv_traits&gt;,boost::numeric::numeric_cast_traits&lt;int,bool&gt;::overflow_policy&gt;, <a class="missing wiki">RawConverter</a>=boost::numeric::raw_converter&lt;conv_traits&gt; </p> </blockquote> <p> ] c:\test\boost\boost\numeric\conversion\cast.hpp(53) : see reference to class template instantiation 'boost::numeric::converter&lt;T,S,Traits,<a class="missing wiki">OverflowHandler</a>,Float2IntRounder,<a class="missing wiki">RawConverter</a>,<a class="missing wiki">UserRangeChecker</a>&gt;' being compiled with [ </p> <blockquote> <p> T=int, S=bool, Traits=conv_traits, <a class="missing wiki">OverflowHandler</a>=boost::numeric::numeric_cast_traits&lt;int,bool&gt;::overflow_policy, Float2IntRounder=boost::numeric::Trunc&lt;bool&gt;, <a class="missing wiki">RawConverter</a>=boost::numeric::raw_converter&lt;conv_traits&gt;, <a class="missing wiki">UserRangeChecker</a>=boost::numeric::numeric_cast_traits&lt;int,bool&gt;::range_checking_policy </p> </blockquote> <p> ] </p> </blockquote> <p> The code that may lead to warning is like this: </p> <pre class="wiki"> int val = boost::numeric_cast&lt;int&gt;(true); </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6297 Trac 1.4.3