Boost C++ Libraries: Ticket #2886: Boost.Array gives MS warnings C4510 and C4610 https://svn.boost.org/trac10/ticket/2886 <p> Boost.Array gives MS warnings C4510 and C4610 in simple use. </p> <blockquote> <p> boost::array&lt;const double, 99&gt; stuff = { 9.206343, ....} </p> </blockquote> <p> Unless anyone can see that this should be fixed 'properly', a patch to push'n'pop and disable these annoying warnings is attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2886 Trac 1.4.3 Paul A. Bristow Wed, 25 Mar 2009 15:41:27 GMT attachment set https://svn.boost.org/trac10/ticket/2886 https://svn.boost.org/trac10/ticket/2886 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">array_warnings.patch</span> </li> </ul> <p> suppress warnings in Boost.array </p> Ticket Steven Watanabe Tue, 19 May 2009 02:56:23 GMT <link>https://svn.boost.org/trac10/ticket/2886#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:1</guid> <description> <p> Why array&lt;const double, 99&gt; rather than const array&lt;double, 99&gt;? </p> <p> Also, array&lt;const double, 99&gt; does not quite work correctly, because iterator::value_type is const double rather than double. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Paul A. Bristow</dc:creator> <pubDate>Tue, 19 May 2009 16:53:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2886#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2886#comment:1" title="Comment 1">steven_watanabe</a>: </p> <blockquote class="citation"> <p> Why array&lt;const double, 99&gt; rather than const array&lt;double, 99&gt;? </p> <p> Also, array&lt;const double, 99&gt; does not quite work correctly, because iterator::value_type is const double rather than double. </p> </blockquote> <p> You are right, as always. </p> <p> Asking for an array of const doubles still *feels* resonable. </p> <p> So, since I am sure I am not the only one to suffer from constant const confusion, it might be useful to document that const array is best, and briefly why? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 22 May 2009 17:08:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2886#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2886#comment:2" title="Comment 2">pbristow</a>: </p> <blockquote class="citation"> <p> Asking for an array of const doubles still *feels* resonable. </p> <p> So, since I am sure I am not the only one to suffer from constant const confusion, it might be useful to document that const array is best, and briefly why? </p> </blockquote> <p> Sure. Now that I have a working doc toolchain again... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Fri, 29 Jan 2010 18:13:25 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/2886#comment:4 https://svn.boost.org/trac10/ticket/2886#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Marshall Clow</span> </li> </ul> <p> Some of this should be fixed in the 1.42 release candidate. Paul, can you check and see if this still occurs there? If so, I can add more warning suppression. </p> Ticket Marshall Clow Fri, 29 Jan 2010 18:13:47 GMT status changed https://svn.boost.org/trac10/ticket/2886#comment:5 https://svn.boost.org/trac10/ticket/2886#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Paul A. Bristow Mon, 01 Feb 2010 10:46:02 GMT <link>https://svn.boost.org/trac10/ticket/2886#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2886#comment:5" title="Comment 5">marshall</a>: </p> <p> I haven't got 1.42 rc yet, but the code appears unchanged in trunk? </p> <p> I am still not clear if the warning should be suppressed (I suspect not suppressing is best) but the array docs should warn that to get an array with const values </p> <blockquote> <p> boost::array&lt;const double, 2&gt; stuff = { 1.2, 3.4}; <em> warnings </em></p> </blockquote> <p> so use instead </p> <blockquote> <p> const boost::array&lt;double, 2&gt; stuff = { 1.2, 3.4}; <em> No warnings. </em></p> </blockquote> <p> As Steven says, this is "because iterator::value_type is const double rather than double. " </p> <p> (But the docs appear to me to be in XML :-( so editing may be troublesome?). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 01 Feb 2010 17:25:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2886#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2886#comment:6" title="Comment 6">pbristow</a>: </p> <blockquote class="citation"> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/2886#comment:5" title="Comment 5">marshall</a>: </p> <p> I haven't got 1.42 rc yet, but the code appears unchanged in trunk? </p> </blockquote> <p> Well, the code has been changed in the trunk. There was some warning suppression (though not specifically 4510 and 4610) added to that file after this bug was opened. I wanted to make sure (not having access to VC9) that this didn't take care of the problems reported here. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Thu, 04 Feb 2010 18:22:17 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2886#comment:8 https://svn.boost.org/trac10/ticket/2886#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/59476" title="Applied patches to fix #2886">[59476]</a>) Applied patches to fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2886" title="#2886: Bugs: Boost.Array gives MS warnings C4510 and C4610 (closed: fixed)">#2886</a> </p> Ticket dimentiy Sun, 19 Dec 2010 23:09:13 GMT <link>https://svn.boost.org/trac10/ticket/2886#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2886#comment:9</guid> <description> <p> I've got those two in 1.41 and can't avoid it. Push and pop around the #include &lt;boost/array.hpp&gt; don't work (vc80). :( </p> </description> <category>Ticket</category> </item> </channel> </rss>