// Copyright Daniel James 2005. Use, modification, and distribution are // subject to 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 "./config.hpp" #include "./functional.hpp" #include "./exception.hpp" #include "./exception_trigger.hpp" #include #include #if !defined(BOOST_OLD_IOSTREAMS) # include #else # include #endif namespace test { // Hash hash::hash(int x) : offset(x) {} hash::hash(hash const& x) : offset(x.offset) { exception_trigger((hash_copy_exception*) 0); } hash& hash::operator=(hash const& x) { exception_trigger((hash_copy_exception*) 0); offset = x.offset; exception_trigger((hash_copy_exception*) 0); return *this; } std::size_t hash::calculate_hash(std::size_t x) const { exception_trigger((hash_exception*) 0); return x + offset; } std::size_t hash::operator()(char const* x) const { return calculate_hash(boost::hash()(x)); } bool hash::operator==(hash const& x) const { return offset == x.offset; } std::ostream& operator<<(std::ostream& out, hash x) { out<<"Test Hash("<