Opened 7 years ago

Closed 6 years ago

#4756 closed Feature Requests (fixed)

Support for C++0x type_index in hash

Reported by: ru.elric@… Owned by: danieljames
Milestone: Boost 1.46.0 Component: hash
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:


Boost hash currently does not support C++0x std::type_index.

Boost has a #define for availability of <typeindex> header - BOOST_NO_0X_HDR_TYPEINDEX. Therefore, adding support for std::type_index should be pretty straightforward.

Something along the lines could do:

#include <typeindex>

namespace boost {
  std::size_t hash_value(const std::type_index &v) {
    return v.hash_code();

Attachments (1)

hash.diff (1.3 KB) - added by ru.elric@… 7 years ago.
Patch that resolves the issue.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by danieljames

  • Milestone changed from To Be Determined to Boost-1.46.0
  • Status changed from new to assigned

Changed 7 years ago by ru.elric@…

Patch that resolves the issue.

comment:2 Changed 6 years ago by danieljames

(In [68145]) Support typeindex in hash. Refs #4756.

comment:3 Changed 6 years ago by anonymous

I believe there is a problem with the patch.

The following forward declaration must not be a template:

template <class Ch, class A>
std::size_t hash_value(std::type_index);

comment:4 Changed 6 years ago by danieljames

(In [68182]) Fix copy and paste typo. Refs #4756.

comment:5 Changed 6 years ago by danieljames

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [68199]) Merge typeindex support for hash. Fixes #4756.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain danieljames.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.