Hash: Merge using SFINAE to avoid implicit casts.

[SVN r79394]
This commit is contained in:
Daniel James
2012-07-09 20:53:36 +00:00
parent dfe0ad3a60
commit 75bcfdeb36
3 changed files with 91 additions and 145 deletions

21
test/implicit_test.cpp Normal file
View File

@@ -0,0 +1,21 @@
// Copyright 2010 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/functional/hash.hpp>
namespace test
{
struct base {};
std::size_t hash_value(base const&) { return 0; }
struct converts { operator base() const { return base(); } };
}
int main() {
boost::hash<test::converts> hash;
test::converts x;
hash(x);
}