Boost C++ Libraries: Ticket #10818: A C4267 "possible loss of data" warning when compiling on VS2013 x64 with /W4 https://svn.boost.org/trac10/ticket/10818 <p> Example: </p> <blockquote> <p> boost::dynamic_bitset&lt;&gt; flags; </p> </blockquote> <p> ... </p> <blockquote> <p> bool b = flags<a class="changeset" href="https://svn.boost.org/trac10/changeset/56" title="*** empty log message *** ">[56]</a>; </p> </blockquote> <p> Warning when calling the reference class constructor from the [] operator. </p> <p> Compiler -- VS2013, Platform -- x64, Debug mode, Warning level -- /W4. </p> <p> Fix: I found if you changed the pos parameter of the reference class constructor to size_type, the warning went away. </p> <p> From: </p> <blockquote> <p> reference(block_type &amp; b, block_type pos) </p> </blockquote> <p> To: </p> <blockquote> <p> reference(block_type &amp; b, size_type pos) </p> </blockquote> <p> Location Line 88 of dynamic_bitset.hpp </p> <p> Actual error message: </p> <p> 4&gt;C:\Boost\1_56_0-VS_2013-x64\include\boost-1_56\boost/dynamic_bitset/dynamic_bitset.hpp(296): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned long', possible loss of data 4&gt; C:\Boost\1_56_0-VS_2013-x64\include\boost-1_56\boost/dynamic_bitset/dynamic_bitset.hpp(295) : while compiling class template member function 'boost::dynamic_bitset&lt;unsigned long,std::allocator&lt;Block&gt;&gt;::reference boost::dynamic_bitset&lt;Block,std::allocator&lt;Block&gt;&gt;::operator [](boost::dynamic_bitset&lt;Block,std::allocator&lt;Block&gt;&gt;::size_type)' </p> <p> reference(block_type &amp; b, size_type pos) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10818 Trac 1.4.3