Modify

Opened 7 years ago

Closed 7 years ago

#4756 closed Feature Requests (fixed)

Support for C++0x type_index in hash

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

Description

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:

#ifndef BOOST_NO_0X_HDR_TYPEINDEX
#include <typeindex>

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

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 Daniel James

Milestone: To Be DeterminedBoost-1.46.0
Status: newassigned

Changed 7 years ago by ru.elric@…

Attachment: hash.diff added

Patch that resolves the issue.

comment:2 Changed 7 years ago by Daniel James

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

comment:3 Changed 7 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 7 years ago by Daniel James

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

comment:5 Changed 7 years ago by Daniel James

Resolution: fixed
Status: assignedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Daniel James.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.