Boost C++ Libraries: Ticket #4811: [string_algo][patch] is_any_of fails to find ::memcpy in c++builder https://svn.boost.org/trac10/ticket/4811 <p> C++builder has a bug in its string.h and cstring headers such that if they are included in the 'wrong' order memcpy is no longer accessible in the global namespace, but is accessible in the std:: namespace. see this<a class="ext-link" href="http://mail-archives.apache.org/mod_mbox/xerces-c-users/200810.mbox/%3C48E5CA01.8050204@mebius.net%3E"><span class="icon">​</span>http://mail-archives.apache.org/mod_mbox/xerces-c-users/200810.mbox/%3C48E5CA01.8050204@mebius.net%3E</a> </p> <p> Given that memcpy is included from cstring then std::memcpy is available and so this simple patch enables this to work in C++Builder. </p> <p> change </p> <pre class="wiki">128 // Use fixed storage 129 ::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); 130 } </pre><p> to </p> <pre class="wiki">128 // Use fixed storage 129 ::std::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); 130 } </pre><p> AND </p> <p> this </p> <pre class="wiki">208 // Copy the data 209 ::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); 210 211 return *this; </pre><p> to this </p> <pre class="wiki">208 // Copy the data 209 ::std::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); 210 211 return *this; </pre><p> This will enable the is_any_of to work again for C++Builder's broken headers. It will also improve the style of the header as all other calls to standard functions are called in the <em>std</em> namespace. </p> <p> Thanks </p> <p> Peter Myerscough-Jackopson </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4811 Trac 1.4.3 Marshall Clow Wed, 28 Dec 2011 18:55:39 GMT owner, component changed https://svn.boost.org/trac10/ticket/4811#comment:1 https://svn.boost.org/trac10/ticket/4811#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Pavol Droba</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>component</strong> <span class="trac-field-old">string_algo</span> → <span class="trac-field-new">algorithm</span> </li> </ul> Ticket Marshall Clow Wed, 28 Dec 2011 19:14:20 GMT <link>https://svn.boost.org/trac10/ticket/4811#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4811#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76213" title="Qualified two calls to memcpy to work around a C++Builder bug; Refs #4811">[76213]</a>) Qualified two calls to memcpy to work around a C++Builder bug; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4811" title="#4811: Bugs: [string_algo][patch] is_any_of fails to find ::memcpy in c++builder (closed: fixed)">#4811</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sun, 01 Jan 2012 21:13:02 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4811#comment:3 https://svn.boost.org/trac10/ticket/4811#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76265" title="Merge Change 76213 to release; Fixes #4811">[76265]</a>) Merge Change 76213 to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4811" title="#4811: Bugs: [string_algo][patch] is_any_of fails to find ::memcpy in c++builder (closed: fixed)">#4811</a> </p> Ticket