Re: [Boost-bugs] [Boost C++ Libraries] #7489: No hash function for classes containing conversion operation to ordinary type

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7489: No hash function for classes containing conversion operation to ordinary type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-09 21:18:22


#7489: No hash function for classes containing conversion operation to ordinary
type
-------------------------------------------------+--------------------------
  Reporter: Robert Luberda <robert@…> | Owner: danieljames
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: hash
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------------+--------------------------

Comment (by anonymous):

 This is deliberate, implicit conversions can cause subtle errors. For a
 case like this it's pretty easy to add support with something like:

 {{{
 friend std::size_t hash_value(MyClass const& v) { return (int) v; }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7489#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC