forked from boostorg/container_hash
Remove unnecessary cross-references
This commit is contained in:
@@ -3,30 +3,30 @@
|
||||
|
||||
:idprefix: tutorial_
|
||||
|
||||
When using a hash index with link:../../../multi_index/index.html[Boost.MultiIndex^], you don't need to do anything to use xref:#ref_hash[boost::hash] as it uses it by default. To find out how to use a user-defined type, read the <<custom,section on extending boost::hash for a custom data type>>.
|
||||
When using a hash index with link:../../../multi_index/index.html[Boost.MultiIndex^], you don't need to do anything to use `boost::hash` as it uses it by default. To find out how to use a user-defined type, read the <<custom,section on extending boost::hash for a custom data type>>.
|
||||
|
||||
If your standard library supplies its own implementation of the unordered associative containers and you wish to use xref:#ref_hash[boost::hash], just use an extra template parameter:
|
||||
If your standard library supplies its own implementation of the unordered associative containers and you wish to use `boost::hash`, just use an extra template parameter:
|
||||
|
||||
[listing,subs="+quotes,+macros"]
|
||||
----
|
||||
std::unordered_multiset<int, xref:#ref_hash[boost::hash]<int> >
|
||||
std::unordered_multiset<int, boost::hash<int> >
|
||||
set_of_ints;
|
||||
|
||||
std::unordered_set<std::pair<int, int>, xref:#ref_hash[boost::hash]<std::pair<int, int> > >
|
||||
std::unordered_set<std::pair<int, int>, boost::hash<std::pair<int, int> > >
|
||||
set_of_pairs;
|
||||
|
||||
std::unordered_map<int, std::string, xref:#ref_hash[boost::hash]<int> > map_int_to_string;
|
||||
std::unordered_map<int, std::string, boost::hash<int> > map_int_to_string;
|
||||
----
|
||||
|
||||
To use xref:#ref_hash[boost::hash] directly, create an instance and call it as a function:
|
||||
To use `boost::hash` directly, create an instance and call it as a function:
|
||||
|
||||
[listing,subs="+quotes,+macros"]
|
||||
----
|
||||
xref:#ref_header_boostcontainer_hashhash_hpp[++#include <boost/container_hash/hash.hpp>++]
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xref:#ref_hash[boost::hash]<std::string> string_hash;
|
||||
boost::hash<std::string> string_hash;
|
||||
|
||||
std::size_t h = string_hash("Hash me");
|
||||
}
|
||||
@@ -41,7 +41,7 @@ std::vector<std::size_t> get_hashes(Container const& x)
|
||||
{
|
||||
std::vector<std::size_t> hashes;
|
||||
std::transform(x.begin(), x.end(), std::back_inserter(hashes),
|
||||
xref:#ref_hash[boost::hash]<typename Container::value_type>());
|
||||
boost::hash<typename Container::value_type>());
|
||||
|
||||
return hashes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user