Boost C++ Libraries: Ticket #1285: [serialization] problem when including shared_ptr_132.hpp https://svn.boost.org/trac10/ticket/1285 <p> It seems that the "using namespace ." statements in this and shared_count_132.hpp trigger a problem in VC8 + SP1. </p> <p> Try the following small program: </p> <p> #include &lt;boost/serialization/shared_ptr_132.hpp&gt; #include &lt;boost/cstdint.hpp&gt; </p> <p> typedef unsigned short uint16_t; </p> <p> int main(int argc, char* argv[]) { </p> <blockquote> <p> uint16_t u; </p> <blockquote> <p> return 0; </p> </blockquote> </blockquote> <p> } </p> <p> Will result in this error: </p> <p> error C2872: 'uint16_t' : ambiguous symbol </p> <p> It seems that the workaround implemented for Borland should be extended to VC8 too: </p> <p> #if !BOOST_WORKAROUND( <span class="underline">BORLANDC</span>, BOOST_TESTED_AT( 0x560) ) using namespace boost; #endif </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1285 Trac 1.4.3 huangsean@… Wed, 26 Sep 2007 23:09:18 GMT <link>https://svn.boost.org/trac10/ticket/1285#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1285#comment:1</guid> <description> <p> Forgot to mention this only happens with debug build. Release version is OK. I turned off the iterator debuging but that did not fix the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 26 Sep 2007 23:10:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1285#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1285#comment:2</guid> <description> <p> Please ignore the above comment. It was meant to another defect I submitted </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 30 Nov 2007 05:58:58 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1285#comment:3 https://svn.boost.org/trac10/ticket/1285#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> try using boost::uint16_t </p> <p> Robert Ramey </p> Ticket huangsean@… Fri, 30 Nov 2007 21:24:14 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1285#comment:4 https://svn.boost.org/trac10/ticket/1285#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Using boost::uint16_t would not be a solution. We have our own uint16_t typedef in our own namespace. Please consider the workaround in my original post. We had to patch our local boost versions that way. </p> Ticket Robert Ramey Fri, 30 Nov 2007 21:29:46 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1285#comment:5 https://svn.boost.org/trac10/ticket/1285#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I'm very disinclined to do such a thing. </p> <p> you've got your own uint16_t and there as boost one and for all I know and std: </p> <p> This would resolve the ambiguity in a way that would hide it from other users and create surprising behavior. </p> Ticket Johan Råde Wed, 13 Feb 2008 17:33:15 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/1285#comment:6 https://svn.boost.org/trac10/ticket/1285#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> <p> Using boost::uint16 instead of uint16_t is not a solution when the problematic uint16_t occurs in some (possible deeply nested) third party header. Especially not when there are third party source files that depend on that header. </p> <p> Moreover, this problem is just a symptom of a more serious problem. Including the header text_iarchive.hpp with Boost 1.35 and MSVC 7.1 has the effect of dumping the entire content of namespace boost into the global scope. The following example illustrates that: </p> <hr /> <p> <em> Expected behavior: Should not compile </em> Observed behavior with Boost 1.34.1 and MSVC 7.1: Does not compile <em> Observed behavior with Boost 1.35 and MSVC 7.1: Does compile </em></p> <p> #include &lt;boost/shared_ptr.hpp&gt; #include &lt;boost/archive/text_iarchive.hpp&gt; shared_ptr&lt;int&gt; sp; </p> Ticket anonymous Wed, 13 Feb 2008 17:36:22 GMT <link>https://svn.boost.org/trac10/ticket/1285#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1285#comment:7</guid> <description> <p> The example in my previous post got a bit mangled. Here we go again: </p> <p> <em> Expected behavior: Should not compile </em> Observed behavior with Boost 1.34.1 and MSVC 7.1: Does not compile <em> Observed behavior with Boost 1.35 and MSVC 7.1: Does compile </em></p> <p> #include &lt;boost/shared_ptr.hpp&gt; #include &lt;boost/archive/text_iarchive.hpp&gt; shared_ptr&lt;int&gt; sp; </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Fri, 11 Apr 2008 05:11:56 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1285#comment:8 https://svn.boost.org/trac10/ticket/1285#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed - will check in soon </p> Ticket Chaker Nakhli (www.javageneration.com) Tue, 23 Dec 2008 09:48:41 GMT status, severity changed; resolution deleted https://svn.boost.org/trac10/ticket/1285#comment:9 https://svn.boost.org/trac10/ticket/1285#comment:9 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Showstopper</span> → <span class="trac-field-new">Problem</span> </li> </ul> <p> This problem persists on boost 1.36. For instance, when &lt;boost/archive/text_iarchive.hpp&gt; is included, the symbols shared_ptr&lt;T&gt; and array&lt;T,N&gt; are available in the default namespace. This prevents correct compilation with /clr option on V8.0 SP1. A new ticket was submitted with number <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2608" title="#2608: Bugs: shared_ptr_132.hpp introduces &#34;using namespace boost&#34; when included (closed: fixed)">#2608</a>. </p> Ticket Robert Ramey Tue, 30 Dec 2008 19:08:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1285#comment:10 https://svn.boost.org/trac10/ticket/1285#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I think this is fixed in 1.37 </p> <p> Robert Ramey </p> Ticket Chaker Nakhli (www.javageneration.com) Mon, 05 Jan 2009 16:25:19 GMT <link>https://svn.boost.org/trac10/ticket/1285#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1285#comment:11</guid> <description> <p> It seems to be OK on 1.37. We had to migrate though (hope the serialization format did not change). Thank you Robert. </p> </description> <category>Ticket</category> </item> </channel> </rss>