Re: [Boost-bugs] [Boost C++ Libraries] #12645: error: no match for call to ‘(const hash) (const boost::recursive_variant_&)’

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12645: error: no match for call to ‘(const hash) (const boost::recursive_variant_&)’
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-03 17:26:34


#12645: error: no match for call to ‘(const hash) (const
boost::recursive_variant_&)’
-------------------------------+------------------------
  Reporter: mike.gresens@… | Owner: ebf
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: variant
   Version: Boost 1.63.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------+------------------------

Comment (by mike.gresens@…):

 Workaround for boost >= 1.62. Not sure what changed since 1.61...

 code:
 {{{
 #include <boost/variant.hpp>
 #include <unordered_set>

 struct hash;

 using int_t = int;

 template <typename T>
 using basic_set_t = std::unordered_set<T, hash>;

 using value_t = boost::make_recursive_variant<
                 int_t,
                 basic_set_t<boost::recursive_variant_>
>::type;

 using set_t = basic_set_t<value_t>;

 struct hash
 {
 boost::recursive_variant_&)’
         size_t operator()(const value_t& value) const
         {
                 return 0;
         }
 };

 // This helps for boost >= 1.62
 namespace std
 {
         template <>
         struct __is_fast_hash<::hash> : std::false_type { };
 }

 int main()
 {
         set_t s;
         int_t i = 3;
         value_t v = i;
         s.emplace(v);
         v = s;
         return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12645#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:20 UTC