Boost C++ Libraries: Ticket #2826: constant boost::mpl::aux::template_arity_impl::value causes 64 bit truncation warning https://svn.boost.org/trac10/ticket/2826 <p> When compiled for a 64 bit target, the constant boost::mpl::aux::template_arity_impl::value causes a warning about possible truncation of a 64 bit value to 32 bits. This is because size_t (returned by sizeof()) is 64 bits, while value is declared as an int. One fix would be to declare the constant as a size_t. Instead I added a static_cast on the assumption that it would be less disruptive and the value returned by sizeof() was unlikely to require more than 32 bits. </p> <pre class="wiki">typename arity_tag&lt;6&gt;::type arity_helper(type_wrapper&lt; F&lt; T1,T2,T3,T4,T5,T6 &gt; &gt;, arity_tag&lt;6&gt;); template&lt; typename F, int N &gt; struct template_arity_impl { BOOST_STATIC_CONSTANT(int, value = static_cast&lt;int&gt;(sizeof(arity_helper(type_wrapper&lt;F&gt;(), arity_tag&lt;N&gt;())) - 1) ); }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2826 Trac 1.4.3 Joel Falcou Sun, 10 Apr 2011 07:35:15 GMT owner, milestone changed; cc set https://svn.boost.org/trac10/ticket/2826#comment:1 https://svn.boost.org/trac10/ticket/2826#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">joel.falcou@…</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">Aleksey Gurtovoy</span> to <span class="trac-author">Joel Falcou</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">Boost 1.47.0</span> </li> </ul> <p> I suspect this bug will be fixed by <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/2297"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/2297</a> Once I applied this one, I'll take care of resting this. Do you have small repro I can use to cross check this issue ? </p> <p> Thanks in advance. </p> Ticket