Boost C++ Libraries: Ticket #13307: multi_index_container can't work with _com_ptr_t https://svn.boost.org/trac10/ticket/13307 <p> I try to use multi_index_container with _com_ptr_t objects. I can compile code with no errors, but program crashes in runtime. </p> <p> Standard containers (std::map, std::set, std::vector) work perfectly with _com_ptr_t. </p> <p> The sample code: </p> <pre class="wiki">#include "stdafx.h" #include &lt;boost\multi_index_container.hpp&gt; #include &lt;boost\multi_index\random_access_index.hpp&gt; #include &lt;boost\multi_index\global_fun.hpp&gt; #include &lt;boost\multi_index\ordered_index.hpp&gt; #import "C:\Windows\SysWOW64\msxml6.dll" exclude("ISequentialStream", "_FILETIME") using CTest = boost::multi_index_container&lt;MSXML2::IXMLDOMDocument2Ptr, boost::multi_index::indexed_by&lt;boost::multi_index::random_access&lt;&gt;&gt;&gt;; int main() { ::CoInitialize(nullptr); CTest tst; MSXML2::IXMLDOMDocumentPtr doc; doc.CreateInstance(CLSID_DOMDocument); **tst.push_back(std::move(doc));** &lt;-- crash here ::CoUninitialize(); return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13307 Trac 1.4.3 andrewaa59gmail.com Tue, 21 Nov 2017 15:09:49 GMT component changed; owner set https://svn.boost.org/trac10/ticket/13307#comment:1 https://svn.boost.org/trac10/ticket/13307#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Joaquín M López Muñoz</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">multi_index</span> </li> </ul> Ticket Andrey Alifanov <andrewaa59gmail.com> Tue, 21 Nov 2017 15:18:22 GMT keywords set https://svn.boost.org/trac10/ticket/13307#comment:2 https://svn.boost.org/trac10/ticket/13307#comment:2 <ul> <li><strong>keywords</strong> c++ Visual Studio _com_ptr_t added </li> </ul> Ticket Joaquín M López Muñoz Thu, 23 Nov 2017 22:35:58 GMT <link>https://svn.boost.org/trac10/ticket/13307#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13307#comment:3</guid> <description> <p> Hi Andrey </p> <p> I think the issue is solved by these two commits: </p> <ul><li><a class="ext-link" href="https://github.com/boostorg/utility/commit/ad0fc7c9d3d21d5ae3d594c41ed47ca71f24ca09"><span class="icon">​</span>https://github.com/boostorg/utility/commit/ad0fc7c9d3d21d5ae3d594c41ed47ca71f24ca09</a> </li><li><a class="ext-link" href="https://github.com/boostorg/multi_index/commit/5744230acfc829914005d8be506a9320d2dc804b"><span class="icon">​</span>https://github.com/boostorg/multi_index/commit/5744230acfc829914005d8be506a9320d2dc804b</a> </li></ul><p> Would you mind patching your local installation of Boost with these and checking whether things work now? The only part where things will still go wrong with overloaded <code>operator&amp;</code> is serialization, but seems the author is working on this in parallel. </p> <p> Thank you, </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 24 Nov 2017 13:20:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13307#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13307#comment:4</guid> <description> <p> Hi Joaquin </p> <p> I'll try it as soon as possible and report about results. Thank you very much for amazingly quick fix. </p> </description> <category>Ticket</category> </item> <item> <author>andrewaa59@…</author> <pubDate>Fri, 24 Nov 2017 14:35:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13307#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13307#comment:5</guid> <description> <p> Hi Joaquin. </p> <p> Anonym - it was me. Very strange UI here. </p> <p> I've tried your fix on my sample code - it seems to be working. At Monday I'll try it on real big code. </p> </description> <category>Ticket</category> </item> <item> <author>andrewaa59@…</author> <pubDate>Tue, 28 Nov 2017 11:25:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13307#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13307#comment:6</guid> <description> <p> Hi Joaquin. </p> <p> I've tried fix in real code - it's working. Thank you very much. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joaquín M López Muñoz</dc:creator> <pubDate>Tue, 28 Nov 2017 13:44:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13307#comment:7 https://svn.boost.org/trac10/ticket/13307#comment:7 <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> Ticket