Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Function template hash_value

boost::hash_value — Provides hashing for variant types so that boost::hash may compute hash.

Synopsis

// In header: <boost/variant/variant.hpp>


template<typename T1, typename T2, ..., typename TN> 
  std::size_t hash_value(const variant<T1, T2, ..., TN> & rhs);

Description

Requires:

Every bounded type of the variant must fulfill the requirements of the Hashable concept.

Effects:

Calls boost::hash<T>()(x), where x is the content of rhs and T is its type.

Notes:

Actually, this function is defined in <boost/variant/detail/hash_variant.hpp> header.

PrevUpHomeNext