mirror of
https://github.com/boostorg/container_hash.git
synced 2026-02-23 15:42:18 +00:00
Merge iostreams, hash.
Including disallowing implicit casts to `hash_value`. [SVN r63812]
This commit is contained in:
21
test/implicit_fail_test.cpp
Normal file
21
test/implicit_fail_test.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user