Modify

Ticket #4756 (closed Feature Requests: fixed)

Opened 4 years ago

Last modified 3 years ago

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:

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

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

Change History

comment:1 Changed 4 years ago by danieljames

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

Changed 3 years ago by ru.elric@…

Patch that resolves the issue.

comment:2 Changed 3 years ago by danieljames

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

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

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

comment:5 Changed 3 years ago by danieljames

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

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.