Hello, I've been trying to add a 'hashable' concept to one of my type erasure requirements, but I haven't been getting anywhere and I still don't understand the voluminous error messages enough to make any progress. Here's approximately what I tried so far: namespace mpl = boost::mpl; namespace te = boost::type_erasure; template<class T> struct hashable { static size_t apply(const T& obj) { return std::hash<T>()(obj); } }; namespace std { template<> class hash<t>{ public : size_t operator()(const test &t ) const { return te::call(hashable<test>(), t); } }; }; typedef mpl::vector< ... hashablete::_self, ...
requirements
typedef any<requirements> test;
namespace std {
template<>
class hash<test>{
public :
size_t operator()(const test&h ) const
{
return te::call(hashable<test>(), h);
}
};
};
I also tried something else, similar to the following:
template<class C>
struct hashable
{
static std::size_t apply(const C& c) { return c.hash(); }
};
namespace boost {
namespace type_erasure {
template