Tweak the portable example.

[SVN r32787]
This commit is contained in:
Daniel James
2006-02-09 19:24:04 +00:00
parent 0a1800f9f8
commit 946d1b9cc3
2 changed files with 21 additions and 14 deletions
+6 -4
View File
@@ -19,8 +19,11 @@ namespace foo
public:
custom_type(T x) : value(x) {}
template <class T2>
friend std::size_t hash_value(foo::custom_type<T2> x);
std::size_t hash() const
{
boost::hash<T> hasher;
return hasher(value);
}
};
}
@@ -33,8 +36,7 @@ namespace foo
template <class T>
std::size_t hash_value(foo::custom_type<T> x)
{
boost::hash<T> hasher;
return hasher(x.value);
return x.hash();
}
}