Boost C++ Libraries: Ticket #11390: Wrong type in dynamic_bitset::reference constructor https://svn.boost.org/trac10/ticket/11390 <p> When compiling with visual studio 2013, the following warning is issued (and since we treat these as errors, fails the compilation): </p> <p> boost/dynamic_bitset/dynamic_bitset.hpp(298): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned long', possible loss of data </p> <p> The culprit is the reference constructor: </p> <p> reference(block_type &amp; b, block_type pos) </p> <p> which should be: </p> <p> reference(block_type &amp; b, block_width_type pos) </p> <p> used in the non-const accessor: </p> <p> reference operator[](size_type pos) { </p> <blockquote> <p> return reference(m_bits[block_index(pos)], bit_index(pos)); </p> </blockquote> <blockquote> <p> } </p> </blockquote> <p> bit_index() is defined as returning block_width_type, not block_type (which may be narrower). </p> <p> The const accessor works as expected and is a possible workaround when read-only access is required from a non-const bitset. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11390 Trac 1.4.3 anonymous Sun, 01 Oct 2017 14:29:32 GMT <link>https://svn.boost.org/trac10/ticket/11390#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11390#comment:1</guid> <description> <p> Does anyone maintain this library? </p> </description> <category>Ticket</category> </item> <item> <author>stefan.atev@…</author> <pubDate>Thu, 02 Nov 2017 20:49:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11390#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11390#comment:2</guid> <description> <p> Apparently it is not maintained, I reported this against 1.58, and it's still in 1.62; I just trained myself to use .set() and .test() </p> </description> <category>Ticket</category> </item> </channel> </rss>