Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6791 closed Feature Requests (fixed)

Support boost::array

Reported by: Olaf van der Spek <olafvdspek@…> Owned by: Marshall Clow
Milestone: To Be Determined Component: array
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

boost::hash_value appears to lack support for boost::array. Could you add it?

Isn't it possible to support all containers in a generic way?

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by Daniel James

Component: hasharray
Owner: changed from Daniel James to Marshall Clow

It isn't possible to do it generically, because equality isn't always defined the same for all containers.

Support needs to be added to array itself, which is pretty easy, it just needs to include <boost/functional/hash_fwd.hpp> and then add something like the following to the same namespace as array (so that it will be picked up by ADL):

template<....>
std::size_t hash_value(array<....> const& x) {
    return boost::hash_range(x.begin(), x.end());
}

comment:2 Changed 6 years ago by Marshall Clow

Resolution: fixed
Status: newclosed

(In [77976]) Added support for Boost.Hash to Boost.Array; fixes #6791

comment:3 Changed 6 years ago by Olaf van der Spek <olafvdspek@…>

It isn't possible to do it generically, because equality isn't always defined the same for all containers.

Does that matter? Can't you just do "return boost::hash_range(x.begin(), x.end());"?

Support needs to be added to array itself,

What about std::array?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Marshall Clow.
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.