diff --git a/doc/changes.qbk b/doc/changes.qbk index 2625e0c..60d17c8 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -43,7 +43,7 @@ the number of times combine is called and hopefully give a better quality hash function. * Improved the algorithm for hashing floating point numbers. - * On Cygwin use a binary hash function for floating point numbers, as + * On Cygwin use a binary hash function for floating point numbers, as Cygwin doesn't have decent floating point functions for `long double`. * Never uses `fpclass` which doesn't support `long double`. * [@http://svn.boost.org/trac/boost/ticket/1064 Ticket 1064]: @@ -75,7 +75,7 @@ functional/hash, not container_hash. `boost/container_hash/detail/container_fwd.hpp` has been moved to `boost/detail/container_fwd.hpp` as it's used outside of this library, the others have been moved to `boost/functional/hash/detail`. - + [h2 Boost 1.39.0] * Move the hash_fwd.hpp implementation into the hash subdirectory, leaving a @@ -201,4 +201,20 @@ already in place for GCC, and was used when Clang pretends to be GCC, but the warning was appearing when running Clang in other contexts. +[h2 Boost 1.67.0] + +* Moved library into its own module, `container_hash`. +* Moved headers for new module name, now at: + ``, + ``, + ``. +* Added forwarding headers to support the old headers locations. +* Support `std::string_view`, `std::error_code`, `std::error_condition` + `std::optional`, `std::variant`, `std::monostate` where available. +* Update include paths from other Boost libraries. +* Manually write out tuple overloads, rather than using the + preprocessor to generate them. Should improve usability, due + to better error messages, and easier debugging. +* Fix tutorial example ([ticket 11017]). + [endsect] diff --git a/doc/samples/tutorial.cpp b/doc/samples/tutorial.cpp new file mode 100644 index 0000000..b11609b --- /dev/null +++ b/doc/samples/tutorial.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include + +//[ get_hashes +template +std::vector get_hashes(Container const& x) +{ + std::vector hashes; + std::transform(x.begin(), x.end(), std::back_inserter(hashes), + boost::hash()); + + return hashes; +} +//] + +int main() { + std::vector values; + values.push_back(10); + values.push_back(20); + + std::vector hashes = get_hashes(values); + assert(hashes[0] = boost::hash()(values[0])); + assert(hashes[1] = boost::hash()(values[1])); +} diff --git a/doc/tutorial.qbk b/doc/tutorial.qbk index f91f173..234b759 100644 --- a/doc/tutorial.qbk +++ b/doc/tutorial.qbk @@ -3,6 +3,9 @@ / 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) ] +[quickbook 1.7] +[import samples/tutorial.cpp] + [def __multi-index-short__ [@boost:/libs/multi_index/doc/index.html Boost.MultiIndex]] @@ -39,15 +42,7 @@ To use [classref boost::hash] directly, create an instance and call it as a func For an example of generic use, here is a function to generate a vector containing the hashes of the elements of a container: - template - std::vector get_hashes(Container const& x) - { - std::vector hashes; - std::transform(x.begin(), x.end(), std::insert_iterator(hashes), - ``[classref boost::hash]``()); - - return hashes; - } +[get_hashes] [endsect]