2005-04-24 14:23:24 +00:00
|
|
|
|
2006-04-17 11:11:49 +00:00
|
|
|
// Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
|
2007-03-18 20:00:59 +00:00
|
|
|
// Copyright (C) 2005-2007 Daniel James
|
2006-07-01 22:34:48 +00:00
|
|
|
// 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)
|
2005-04-24 14:23:24 +00:00
|
|
|
|
|
|
|
#ifndef BOOST_UNORDERED_DETAIL_HASH_TABLE_HPP_INCLUDED
|
|
|
|
#define BOOST_UNORDERED_DETAIL_HASH_TABLE_HPP_INCLUDED
|
|
|
|
|
2005-06-20 21:55:28 +00:00
|
|
|
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
|
|
# pragma once
|
|
|
|
#endif
|
|
|
|
|
2005-04-24 14:23:24 +00:00
|
|
|
#include <boost/config.hpp>
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cmath>
|
|
|
|
#include <algorithm>
|
|
|
|
#include <utility>
|
2007-11-16 00:31:12 +00:00
|
|
|
#include <stdexcept>
|
2005-04-24 14:23:24 +00:00
|
|
|
|
|
|
|
#include <boost/iterator.hpp>
|
|
|
|
#include <boost/iterator/iterator_categories.hpp>
|
2005-11-05 16:57:31 +00:00
|
|
|
#include <boost/limits.hpp>
|
2005-04-24 14:23:24 +00:00
|
|
|
#include <boost/assert.hpp>
|
|
|
|
#include <boost/static_assert.hpp>
|
|
|
|
#include <boost/unordered/detail/allocator.hpp>
|
|
|
|
#include <boost/type_traits/is_same.hpp>
|
|
|
|
#include <boost/mpl/if.hpp>
|
|
|
|
#include <boost/mpl/and.hpp>
|
2006-02-26 18:33:49 +00:00
|
|
|
#include <boost/detail/workaround.hpp>
|
2005-04-24 14:23:24 +00:00
|
|
|
|
|
|
|
#include <boost/mpl/aux_/config/eti.hpp>
|
|
|
|
|
2006-02-26 18:33:49 +00:00
|
|
|
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
|
|
|
|
#define BOOST_HASH_BORLAND_BOOL(x) (bool)(x)
|
|
|
|
#else
|
|
|
|
#define BOOST_HASH_BORLAND_BOOL(x) x
|
|
|
|
#endif
|
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
2006-06-12 23:30:46 +00:00
|
|
|
#define BOOST_HASH_MSVC_RESET_PTR(x) unordered_detail::reset(x)
|
2006-05-07 13:24:17 +00:00
|
|
|
#else
|
|
|
|
#define BOOST_HASH_MSVC_RESET_PTR(x)
|
|
|
|
#endif
|
|
|
|
|
2005-04-24 14:23:24 +00:00
|
|
|
namespace boost {
|
|
|
|
namespace unordered_detail {
|
|
|
|
template <class T> struct type_wrapper {};
|
|
|
|
|
|
|
|
const static std::size_t default_initial_bucket_count = 50;
|
2006-06-12 23:30:46 +00:00
|
|
|
const static float minimum_max_load_factor = 1e-3f;
|
2005-04-24 14:23:24 +00:00
|
|
|
inline std::size_t next_prime(std::size_t n);
|
|
|
|
|
|
|
|
template <class T>
|
2006-02-26 18:33:49 +00:00
|
|
|
inline void hash_swap(T& x, T& y)
|
2005-04-24 14:23:24 +00:00
|
|
|
{
|
2006-03-20 20:00:55 +00:00
|
|
|
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
|
|
|
std::swap(x,y);
|
|
|
|
#else
|
2006-05-21 17:10:03 +00:00
|
|
|
using std::swap;
|
2005-04-24 14:23:24 +00:00
|
|
|
swap(x, y);
|
2006-03-20 20:00:55 +00:00
|
|
|
#endif
|
2005-04-24 14:23:24 +00:00
|
|
|
}
|
|
|
|
|
2006-02-26 18:33:49 +00:00
|
|
|
inline std::size_t float_to_size_t(float f)
|
2005-11-05 16:57:31 +00:00
|
|
|
{
|
2006-02-26 18:33:49 +00:00
|
|
|
return f > static_cast<float>((std::numeric_limits<std::size_t>::max)()) ?
|
2005-11-05 16:57:31 +00:00
|
|
|
(std::numeric_limits<std::size_t>::max)() :
|
|
|
|
static_cast<std::size_t>(f);
|
|
|
|
}
|
|
|
|
|
2005-04-24 14:23:24 +00:00
|
|
|
// prime number list, accessor
|
|
|
|
|
|
|
|
static const std::size_t prime_list[] = {
|
|
|
|
53ul, 97ul, 193ul, 389ul, 769ul,
|
|
|
|
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
|
|
|
|
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
|
|
|
|
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
|
|
|
|
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
|
|
|
|
1610612741ul, 3221225473ul, 4294967291ul };
|
|
|
|
|
|
|
|
// no throw
|
|
|
|
inline std::size_t next_prime(std::size_t n) {
|
Merged revisions 41822-41992,41994-42101 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev
........
r41822 | danieljames | 2007-12-07 12:51:54 +0000 (Fri, 07 Dec 2007) | 5 lines
Change the macros to meet boost guidelines.
I should really have done this before the review. At least it'll give them
something to say.
........
r41928 | danieljames | 2007-12-09 19:23:27 +0000 (Sun, 09 Dec 2007) | 1 line
Add some parameters to standalone documentation build.
........
r41929 | danieljames | 2007-12-09 19:24:07 +0000 (Sun, 09 Dec 2007) | 1 line
An extra rehash test for inserting a range.
........
r41930 | danieljames | 2007-12-09 19:24:52 +0000 (Sun, 09 Dec 2007) | 1 line
get_for_erase can be static because all the required information is in the iterator.
........
r41931 | danieljames | 2007-12-09 19:31:00 +0000 (Sun, 09 Dec 2007) | 1 line
ADL doesn't seem to be working properly on Visual C++ 7.1 when calling swap, so workaround this in the compile tests.
........
r41932 | danieljames | 2007-12-09 19:44:46 +0000 (Sun, 09 Dec 2007) | 1 line
Try to make the erase exception requirements a little clearer.
........
r41933 | danieljames | 2007-12-09 19:52:50 +0000 (Sun, 09 Dec 2007) | 1 line
Hopefully clearer comparison of accessors for comparison/hash function objects.
........
r41943 | danieljames | 2007-12-10 00:03:53 +0000 (Mon, 10 Dec 2007) | 1 line
Fix a typo.
........
r41951 | danieljames | 2007-12-10 11:08:02 +0000 (Mon, 10 Dec 2007) | 1 line
Use the locale in the case insensitive comparison, I really should add a test for this.
........
r41994 | danieljames | 2007-12-13 00:26:05 +0000 (Thu, 13 Dec 2007) | 3 lines
Hervé Brönnimann's improved explanation of the formula for avoiding
invalidating iterators.
........
r41995 | danieljames | 2007-12-13 00:30:46 +0000 (Thu, 13 Dec 2007) | 4 lines
Explicity use the classic locale in the case insensitive example. I could make
the locale a member, but that would make the example longer. Also, this would be
a good place to put a note about the need for constant function objects.
........
r41996 | danieljames | 2007-12-13 00:31:55 +0000 (Thu, 13 Dec 2007) | 1 line
Pull the point examples out into test files - fixing a few bugs in the process.
........
r41997 | danieljames | 2007-12-13 00:41:30 +0000 (Thu, 13 Dec 2007) | 3 lines
A few reference links for boost::hash, it might be better to link to the
first page of the Boost.Hash documentation though.
........
r42092 | danieljames | 2007-12-16 10:07:27 +0000 (Sun, 16 Dec 2007) | 2 lines
Fix some typos, and use American spelling.
........
r42093 | danieljames | 2007-12-16 10:11:00 +0000 (Sun, 16 Dec 2007) | 1 line
Small documentation tweak.
........
r42096 | danieljames | 2007-12-16 10:17:03 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some reference documentation errors.
........
r42097 | danieljames | 2007-12-16 10:28:08 +0000 (Sun, 16 Dec 2007) | 1 line
Document the explicit constructors.
........
r42098 | danieljames | 2007-12-16 10:47:13 +0000 (Sun, 16 Dec 2007) | 1 line
Try to make the active issues and proposals a little clearer - including more obvious links to the relevant papers.
........
r42099 | danieljames | 2007-12-16 10:52:30 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some complexity errors in the comparison table.
........
r42100 | danieljames | 2007-12-16 10:59:45 +0000 (Sun, 16 Dec 2007) | 1 line
Use Mapped instead of T in the documentation.
........
r42101 | danieljames | 2007-12-16 11:06:16 +0000 (Sun, 16 Dec 2007) | 1 line
Remove hard-coded length of prime numbers.
........
[SVN r42187]
2007-12-19 23:09:09 +00:00
|
|
|
std::size_t const* const prime_list_end = prime_list +
|
|
|
|
sizeof(prime_list) / sizeof(*prime_list);
|
2005-04-24 14:23:24 +00:00
|
|
|
std::size_t const* bound =
|
Merged revisions 41822-41992,41994-42101 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev
........
r41822 | danieljames | 2007-12-07 12:51:54 +0000 (Fri, 07 Dec 2007) | 5 lines
Change the macros to meet boost guidelines.
I should really have done this before the review. At least it'll give them
something to say.
........
r41928 | danieljames | 2007-12-09 19:23:27 +0000 (Sun, 09 Dec 2007) | 1 line
Add some parameters to standalone documentation build.
........
r41929 | danieljames | 2007-12-09 19:24:07 +0000 (Sun, 09 Dec 2007) | 1 line
An extra rehash test for inserting a range.
........
r41930 | danieljames | 2007-12-09 19:24:52 +0000 (Sun, 09 Dec 2007) | 1 line
get_for_erase can be static because all the required information is in the iterator.
........
r41931 | danieljames | 2007-12-09 19:31:00 +0000 (Sun, 09 Dec 2007) | 1 line
ADL doesn't seem to be working properly on Visual C++ 7.1 when calling swap, so workaround this in the compile tests.
........
r41932 | danieljames | 2007-12-09 19:44:46 +0000 (Sun, 09 Dec 2007) | 1 line
Try to make the erase exception requirements a little clearer.
........
r41933 | danieljames | 2007-12-09 19:52:50 +0000 (Sun, 09 Dec 2007) | 1 line
Hopefully clearer comparison of accessors for comparison/hash function objects.
........
r41943 | danieljames | 2007-12-10 00:03:53 +0000 (Mon, 10 Dec 2007) | 1 line
Fix a typo.
........
r41951 | danieljames | 2007-12-10 11:08:02 +0000 (Mon, 10 Dec 2007) | 1 line
Use the locale in the case insensitive comparison, I really should add a test for this.
........
r41994 | danieljames | 2007-12-13 00:26:05 +0000 (Thu, 13 Dec 2007) | 3 lines
Hervé Brönnimann's improved explanation of the formula for avoiding
invalidating iterators.
........
r41995 | danieljames | 2007-12-13 00:30:46 +0000 (Thu, 13 Dec 2007) | 4 lines
Explicity use the classic locale in the case insensitive example. I could make
the locale a member, but that would make the example longer. Also, this would be
a good place to put a note about the need for constant function objects.
........
r41996 | danieljames | 2007-12-13 00:31:55 +0000 (Thu, 13 Dec 2007) | 1 line
Pull the point examples out into test files - fixing a few bugs in the process.
........
r41997 | danieljames | 2007-12-13 00:41:30 +0000 (Thu, 13 Dec 2007) | 3 lines
A few reference links for boost::hash, it might be better to link to the
first page of the Boost.Hash documentation though.
........
r42092 | danieljames | 2007-12-16 10:07:27 +0000 (Sun, 16 Dec 2007) | 2 lines
Fix some typos, and use American spelling.
........
r42093 | danieljames | 2007-12-16 10:11:00 +0000 (Sun, 16 Dec 2007) | 1 line
Small documentation tweak.
........
r42096 | danieljames | 2007-12-16 10:17:03 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some reference documentation errors.
........
r42097 | danieljames | 2007-12-16 10:28:08 +0000 (Sun, 16 Dec 2007) | 1 line
Document the explicit constructors.
........
r42098 | danieljames | 2007-12-16 10:47:13 +0000 (Sun, 16 Dec 2007) | 1 line
Try to make the active issues and proposals a little clearer - including more obvious links to the relevant papers.
........
r42099 | danieljames | 2007-12-16 10:52:30 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some complexity errors in the comparison table.
........
r42100 | danieljames | 2007-12-16 10:59:45 +0000 (Sun, 16 Dec 2007) | 1 line
Use Mapped instead of T in the documentation.
........
r42101 | danieljames | 2007-12-16 11:06:16 +0000 (Sun, 16 Dec 2007) | 1 line
Remove hard-coded length of prime numbers.
........
[SVN r42187]
2007-12-19 23:09:09 +00:00
|
|
|
std::lower_bound(prime_list,prime_list_end, n);
|
|
|
|
if(bound == prime_list_end)
|
2005-04-24 14:23:24 +00:00
|
|
|
bound--;
|
|
|
|
return *bound;
|
|
|
|
}
|
|
|
|
|
2005-11-05 16:57:31 +00:00
|
|
|
// no throw
|
|
|
|
inline std::size_t prev_prime(std::size_t n) {
|
Merged revisions 41822-41992,41994-42101 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev
........
r41822 | danieljames | 2007-12-07 12:51:54 +0000 (Fri, 07 Dec 2007) | 5 lines
Change the macros to meet boost guidelines.
I should really have done this before the review. At least it'll give them
something to say.
........
r41928 | danieljames | 2007-12-09 19:23:27 +0000 (Sun, 09 Dec 2007) | 1 line
Add some parameters to standalone documentation build.
........
r41929 | danieljames | 2007-12-09 19:24:07 +0000 (Sun, 09 Dec 2007) | 1 line
An extra rehash test for inserting a range.
........
r41930 | danieljames | 2007-12-09 19:24:52 +0000 (Sun, 09 Dec 2007) | 1 line
get_for_erase can be static because all the required information is in the iterator.
........
r41931 | danieljames | 2007-12-09 19:31:00 +0000 (Sun, 09 Dec 2007) | 1 line
ADL doesn't seem to be working properly on Visual C++ 7.1 when calling swap, so workaround this in the compile tests.
........
r41932 | danieljames | 2007-12-09 19:44:46 +0000 (Sun, 09 Dec 2007) | 1 line
Try to make the erase exception requirements a little clearer.
........
r41933 | danieljames | 2007-12-09 19:52:50 +0000 (Sun, 09 Dec 2007) | 1 line
Hopefully clearer comparison of accessors for comparison/hash function objects.
........
r41943 | danieljames | 2007-12-10 00:03:53 +0000 (Mon, 10 Dec 2007) | 1 line
Fix a typo.
........
r41951 | danieljames | 2007-12-10 11:08:02 +0000 (Mon, 10 Dec 2007) | 1 line
Use the locale in the case insensitive comparison, I really should add a test for this.
........
r41994 | danieljames | 2007-12-13 00:26:05 +0000 (Thu, 13 Dec 2007) | 3 lines
Hervé Brönnimann's improved explanation of the formula for avoiding
invalidating iterators.
........
r41995 | danieljames | 2007-12-13 00:30:46 +0000 (Thu, 13 Dec 2007) | 4 lines
Explicity use the classic locale in the case insensitive example. I could make
the locale a member, but that would make the example longer. Also, this would be
a good place to put a note about the need for constant function objects.
........
r41996 | danieljames | 2007-12-13 00:31:55 +0000 (Thu, 13 Dec 2007) | 1 line
Pull the point examples out into test files - fixing a few bugs in the process.
........
r41997 | danieljames | 2007-12-13 00:41:30 +0000 (Thu, 13 Dec 2007) | 3 lines
A few reference links for boost::hash, it might be better to link to the
first page of the Boost.Hash documentation though.
........
r42092 | danieljames | 2007-12-16 10:07:27 +0000 (Sun, 16 Dec 2007) | 2 lines
Fix some typos, and use American spelling.
........
r42093 | danieljames | 2007-12-16 10:11:00 +0000 (Sun, 16 Dec 2007) | 1 line
Small documentation tweak.
........
r42096 | danieljames | 2007-12-16 10:17:03 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some reference documentation errors.
........
r42097 | danieljames | 2007-12-16 10:28:08 +0000 (Sun, 16 Dec 2007) | 1 line
Document the explicit constructors.
........
r42098 | danieljames | 2007-12-16 10:47:13 +0000 (Sun, 16 Dec 2007) | 1 line
Try to make the active issues and proposals a little clearer - including more obvious links to the relevant papers.
........
r42099 | danieljames | 2007-12-16 10:52:30 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some complexity errors in the comparison table.
........
r42100 | danieljames | 2007-12-16 10:59:45 +0000 (Sun, 16 Dec 2007) | 1 line
Use Mapped instead of T in the documentation.
........
r42101 | danieljames | 2007-12-16 11:06:16 +0000 (Sun, 16 Dec 2007) | 1 line
Remove hard-coded length of prime numbers.
........
[SVN r42187]
2007-12-19 23:09:09 +00:00
|
|
|
std::size_t const* const prime_list_end = prime_list +
|
|
|
|
sizeof(prime_list) / sizeof(*prime_list);
|
2005-11-05 16:57:31 +00:00
|
|
|
std::size_t const* bound =
|
Merged revisions 41822-41992,41994-42101 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev
........
r41822 | danieljames | 2007-12-07 12:51:54 +0000 (Fri, 07 Dec 2007) | 5 lines
Change the macros to meet boost guidelines.
I should really have done this before the review. At least it'll give them
something to say.
........
r41928 | danieljames | 2007-12-09 19:23:27 +0000 (Sun, 09 Dec 2007) | 1 line
Add some parameters to standalone documentation build.
........
r41929 | danieljames | 2007-12-09 19:24:07 +0000 (Sun, 09 Dec 2007) | 1 line
An extra rehash test for inserting a range.
........
r41930 | danieljames | 2007-12-09 19:24:52 +0000 (Sun, 09 Dec 2007) | 1 line
get_for_erase can be static because all the required information is in the iterator.
........
r41931 | danieljames | 2007-12-09 19:31:00 +0000 (Sun, 09 Dec 2007) | 1 line
ADL doesn't seem to be working properly on Visual C++ 7.1 when calling swap, so workaround this in the compile tests.
........
r41932 | danieljames | 2007-12-09 19:44:46 +0000 (Sun, 09 Dec 2007) | 1 line
Try to make the erase exception requirements a little clearer.
........
r41933 | danieljames | 2007-12-09 19:52:50 +0000 (Sun, 09 Dec 2007) | 1 line
Hopefully clearer comparison of accessors for comparison/hash function objects.
........
r41943 | danieljames | 2007-12-10 00:03:53 +0000 (Mon, 10 Dec 2007) | 1 line
Fix a typo.
........
r41951 | danieljames | 2007-12-10 11:08:02 +0000 (Mon, 10 Dec 2007) | 1 line
Use the locale in the case insensitive comparison, I really should add a test for this.
........
r41994 | danieljames | 2007-12-13 00:26:05 +0000 (Thu, 13 Dec 2007) | 3 lines
Hervé Brönnimann's improved explanation of the formula for avoiding
invalidating iterators.
........
r41995 | danieljames | 2007-12-13 00:30:46 +0000 (Thu, 13 Dec 2007) | 4 lines
Explicity use the classic locale in the case insensitive example. I could make
the locale a member, but that would make the example longer. Also, this would be
a good place to put a note about the need for constant function objects.
........
r41996 | danieljames | 2007-12-13 00:31:55 +0000 (Thu, 13 Dec 2007) | 1 line
Pull the point examples out into test files - fixing a few bugs in the process.
........
r41997 | danieljames | 2007-12-13 00:41:30 +0000 (Thu, 13 Dec 2007) | 3 lines
A few reference links for boost::hash, it might be better to link to the
first page of the Boost.Hash documentation though.
........
r42092 | danieljames | 2007-12-16 10:07:27 +0000 (Sun, 16 Dec 2007) | 2 lines
Fix some typos, and use American spelling.
........
r42093 | danieljames | 2007-12-16 10:11:00 +0000 (Sun, 16 Dec 2007) | 1 line
Small documentation tweak.
........
r42096 | danieljames | 2007-12-16 10:17:03 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some reference documentation errors.
........
r42097 | danieljames | 2007-12-16 10:28:08 +0000 (Sun, 16 Dec 2007) | 1 line
Document the explicit constructors.
........
r42098 | danieljames | 2007-12-16 10:47:13 +0000 (Sun, 16 Dec 2007) | 1 line
Try to make the active issues and proposals a little clearer - including more obvious links to the relevant papers.
........
r42099 | danieljames | 2007-12-16 10:52:30 +0000 (Sun, 16 Dec 2007) | 1 line
Fix some complexity errors in the comparison table.
........
r42100 | danieljames | 2007-12-16 10:59:45 +0000 (Sun, 16 Dec 2007) | 1 line
Use Mapped instead of T in the documentation.
........
r42101 | danieljames | 2007-12-16 11:06:16 +0000 (Sun, 16 Dec 2007) | 1 line
Remove hard-coded length of prime numbers.
........
[SVN r42187]
2007-12-19 23:09:09 +00:00
|
|
|
std::upper_bound(prime_list,prime_list_end, n);
|
2005-11-05 16:57:31 +00:00
|
|
|
if(bound != prime_list)
|
|
|
|
bound--;
|
|
|
|
return *bound;
|
|
|
|
}
|
|
|
|
|
2005-04-24 14:23:24 +00:00
|
|
|
// pair_cast - used to convert between pair types.
|
|
|
|
|
|
|
|
template <class Dst1, class Dst2, class Src1, class Src2>
|
|
|
|
inline std::pair<Dst1, Dst2> pair_cast(std::pair<Src1, Src2> const& x)
|
|
|
|
{
|
|
|
|
return std::pair<Dst1, Dst2>(Dst1(x.first), Dst2(x.second));
|
|
|
|
}
|
2006-05-07 13:24:17 +00:00
|
|
|
}
|
|
|
|
}
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
#define BOOST_UNORDERED_HASH_EQUIVALENT 1
|
|
|
|
#include <boost/unordered/detail/hash_table_impl.hpp>
|
|
|
|
#undef BOOST_UNORDERED_HASH_EQUIVALENT
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
#define BOOST_UNORDERED_HASH_EQUIVALENT 0
|
|
|
|
#include <boost/unordered/detail/hash_table_impl.hpp>
|
|
|
|
#undef BOOST_UNORDERED_HASH_EQUIVALENT
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
namespace boost {
|
|
|
|
namespace unordered_detail {
|
|
|
|
class iterator_access
|
2005-04-24 14:23:24 +00:00
|
|
|
{
|
2005-06-20 21:55:28 +00:00
|
|
|
public:
|
2006-05-07 13:24:17 +00:00
|
|
|
template <class Iterator>
|
|
|
|
static BOOST_DEDUCED_TYPENAME Iterator::base const& get(Iterator const& it) {
|
|
|
|
return it.base_;
|
|
|
|
}
|
2005-04-24 14:23:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template <class ValueType, class KeyType,
|
2006-05-07 13:24:17 +00:00
|
|
|
class Hash, class Pred, class Alloc>
|
|
|
|
class hash_types_unique_keys
|
2005-04-24 14:23:24 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME
|
|
|
|
boost::unordered_detail::rebind_wrap<Alloc, ValueType>::type
|
|
|
|
value_allocator;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef hash_table_unique_keys<ValueType, KeyType, Hash, Pred,
|
|
|
|
value_allocator> hash_table;
|
|
|
|
typedef hash_table_data_unique_keys<value_allocator> data;
|
2005-06-20 21:55:28 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME data::iterator_base iterator_base;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef hash_const_local_iterator_unique_keys<value_allocator> const_local_iterator;
|
|
|
|
typedef hash_local_iterator_unique_keys<value_allocator> local_iterator;
|
|
|
|
typedef hash_const_iterator_unique_keys<value_allocator> const_iterator;
|
|
|
|
typedef hash_iterator_unique_keys<value_allocator> iterator;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME data::size_type size_type;
|
|
|
|
typedef std::ptrdiff_t difference_type;
|
2005-04-24 14:23:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template <class ValueType, class KeyType,
|
2006-05-07 13:24:17 +00:00
|
|
|
class Hash, class Pred, class Alloc>
|
|
|
|
class hash_types_equivalent_keys
|
2005-04-24 14:23:24 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-06-20 21:55:28 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME
|
|
|
|
boost::unordered_detail::rebind_wrap<Alloc, ValueType>::type
|
|
|
|
value_allocator;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef hash_table_equivalent_keys<ValueType, KeyType, Hash, Pred,
|
|
|
|
value_allocator> hash_table;
|
|
|
|
typedef hash_table_data_equivalent_keys<value_allocator> data;
|
2005-06-20 21:55:28 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME data::iterator_base iterator_base;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2006-05-07 13:24:17 +00:00
|
|
|
typedef hash_const_local_iterator_equivalent_keys<value_allocator> const_local_iterator;
|
|
|
|
typedef hash_local_iterator_equivalent_keys<value_allocator> local_iterator;
|
|
|
|
typedef hash_const_iterator_equivalent_keys<value_allocator> const_iterator;
|
|
|
|
typedef hash_iterator_equivalent_keys<value_allocator> iterator;
|
2005-04-24 14:23:24 +00:00
|
|
|
|
2005-06-20 21:55:28 +00:00
|
|
|
typedef BOOST_DEDUCED_TYPENAME data::size_type size_type;
|
2005-04-24 14:23:24 +00:00
|
|
|
typedef std::ptrdiff_t difference_type;
|
|
|
|
};
|
|
|
|
} // namespace boost::unordered_detail
|
|
|
|
} // namespace boost
|
|
|
|
|
2006-02-26 18:33:49 +00:00
|
|
|
#undef BOOST_HASH_BORLAND_BOOL
|
2006-05-07 13:24:17 +00:00
|
|
|
#undef BOOST_HASH_MSVC_RESET_PTR
|
2006-02-26 18:33:49 +00:00
|
|
|
|
2005-04-24 14:23:24 +00:00
|
|
|
#endif // BOOST_UNORDERED_DETAIL_HASH_TABLE_HPP_INCLUDED
|