$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Using hash_range with polymorphism
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-12-01 10:10:15
Kelvin Chung wrote:
> // It would be nice to have a template that does this so I don't have to
> do this for every leaf class
> std::size_t hash_value(const Foo1& foo1) { return foo1.hash(); }
You don't need to define hash_value for the leaf classes, only for the base
class.
std::size_t hash_value(const Foo& foo) { return foo.hash(); }