Boost logo

Boost Users :

Subject: [Boost-users] functional/hash and mp_math weirdness
From: Andrea Bedini (andrea.bedini_at_[hidden])
Date: 2009-07-05 17:39:48


Hello,

I'm experiencing troubles with functional/hash

#include <boost/functional/hash.hpp> #include
<boost/mp_math/integer.hpp>

typedef boost::mp_math::integer<> big_integer;

class A {
  friend A operator*( const big_integer& lhs, const A& rhs ) {}
};

gives the following madness. What surprises me is that I am not making
any use of functional/hash (in the actual code, it gets included from
boost/unordered_map.hpp), as the error messages don't indicate any line
of my code. I think mp_math is not playing a big role here, once I had
the same problem with a homemade class (but unfortunately I can't now
replicate the same conditions).

Can anyone explain me what is going on here ?

Thanks you all in advice, Andrea

/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp: In
instantiation of 'boost::detail::static_log2_impl::static_log2_impl<2ul,
16>':
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:117:
instantiated from 'boost::static_log2<2ul>'
/home/andrea/boost_1_39_0/boost/functional/hash/detail/hash_float.hpp:150:
  instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with
  T = float]'
/home/andrea/boost_1_39_0/boost/functional/hash/detail/hash_float.hpp:187:
  instantiated from 'size_t boost::hash_detail::float_hash_value(T)
  [with T =
float]'
/home/andrea/boost_1_39_0/boost/functional/hash/hash.hpp:304:
instantiated from here
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:89:
error: 'boost::detail::static_log2_impl::static_log2_impl<2ul,
16>::<anonymous enum>' is/uses anonymous type
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:89:
error: trying to instantiate 'template<class Type> template<class T1>
boost::mp_math::integer::integer(const T1&)'
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp: In
instantiation of 'boost::detail::static_log2_impl::static_log2_impl<2ul,
8>':
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:89:
instantiated from
'boost::detail::static_log2_impl::static_log2_impl<2ul, 16>'
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:117:
instantiated from 'boost::static_log2<2ul>'
/home/andrea/boost_1_39_0/boost/functional/hash/detail/hash_float.hpp:150:
  instantiated from 'size_t boost::hash_detail::float_hash_impl(T) [with
  T = float]'
/home/andrea/boost_1_39_0/boost/functional/hash/detail/hash_float.hpp:187:
  instantiated from 'size_t boost::hash_detail::float_hash_value(T)
  [with T =
float]'
/home/andrea/boost_1_39_0/boost/functional/hash/hash.hpp:304:
instantiated from here
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:89:
error: 'boost::detail::static_log2_impl::static_log2_impl<2ul,
8>::<anonymous enum>' is/uses anonymous type
/home/andrea/boost_1_39_0/boost/integer/static_log2.hpp:89:
error: trying to instantiate 'template<class Type> template<class T1>
boost::mp_math::integer::integer(const T1&)'
...
...


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net