Boost C++ Libraries: Ticket #4756: Support for C++0x type_index in hash https://svn.boost.org/trac10/ticket/4756 <p> Boost hash currently does not support C++0x std::type_index. </p> <p> Boost has a #define for availability of &lt;typeindex&gt; header - BOOST_NO_0X_HDR_TYPEINDEX. Therefore, adding support for std::type_index should be pretty straightforward. </p> <p> Something along the lines could do: </p> <pre class="wiki">#ifndef BOOST_NO_0X_HDR_TYPEINDEX #include &lt;typeindex&gt; namespace boost { std::size_t hash_value(const std::type_index &amp;v) { return v.hash_code(); } } #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4756 Trac 1.4.3 Daniel James Tue, 19 Oct 2010 10:34:40 GMT status, milestone changed https://svn.boost.org/trac10/ticket/4756#comment:1 https://svn.boost.org/trac10/ticket/4756#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost-1.46.0</span> </li> </ul> Ticket ru.elric@… Sun, 12 Dec 2010 10:03:33 GMT attachment set https://svn.boost.org/trac10/ticket/4756 https://svn.boost.org/trac10/ticket/4756 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">hash.diff</span> </li> </ul> <p> Patch that resolves the issue. </p> Ticket Daniel James Fri, 14 Jan 2011 03:13:41 GMT <link>https://svn.boost.org/trac10/ticket/4756#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4756#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/68145" title="Support typeindex in hash. Refs #4756.">[68145]</a>) Support typeindex in hash. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4756" title="#4756: Feature Requests: Support for C++0x type_index in hash (closed: fixed)">#4756</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 16 Jan 2011 10:41:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4756#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4756#comment:3</guid> <description> <p> I believe there is a problem with the patch. </p> <p> The following forward declaration must not be a template: </p> <pre class="wiki">template &lt;class Ch, class A&gt; std::size_t hash_value(std::type_index); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Sun, 16 Jan 2011 11:06:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4756#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4756#comment:4</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/68182" title="Fix copy and paste typo. Refs #4756.">[68182]</a>) Fix copy and paste typo. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4756" title="#4756: Feature Requests: Support for C++0x type_index in hash (closed: fixed)">#4756</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 17 Jan 2011 04:15:23 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4756#comment:5 https://svn.boost.org/trac10/ticket/4756#comment:5 <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/68199" title="Merge typeindex support for hash. Fixes #4756. ">[68199]</a>) Merge typeindex support for hash. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4756" title="#4756: Feature Requests: Support for C++0x type_index in hash (closed: fixed)">#4756</a>. </p> Ticket