forked from boostorg/unordered
Use pre-review copy of unordered for trunk.
[SVN r42183]
This commit is contained in:
@@ -42,9 +42,6 @@ namespace boost {
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <class T>
|
||||
inline void reset(T& x) { x = T(); }
|
||||
|
||||
template <class Ptr>
|
||||
inline Ptr null_ptr() { return Ptr(); }
|
||||
#else
|
||||
template <class T>
|
||||
inline void reset_impl(T& x, ...) { x = T(); }
|
||||
@@ -52,9 +49,6 @@ namespace boost {
|
||||
inline void reset_impl(T*& x, int) { x = 0; }
|
||||
template <class T>
|
||||
inline void reset(T& x) { reset_impl(x); }
|
||||
|
||||
template <class Ptr>
|
||||
inline Ptr null_ptr() { Ptr x; reset(x); return x; }
|
||||
#endif
|
||||
|
||||
// Work around for Microsoft's ETI bug.
|
||||
|
||||
@@ -82,21 +82,17 @@ namespace boost {
|
||||
|
||||
// no throw
|
||||
inline std::size_t next_prime(std::size_t n) {
|
||||
std::size_t const* const prime_list_end = prime_list +
|
||||
sizeof(prime_list) / sizeof(*prime_list);
|
||||
std::size_t const* bound =
|
||||
std::lower_bound(prime_list,prime_list_end, n);
|
||||
if(bound == prime_list_end)
|
||||
std::lower_bound(prime_list,prime_list + 28, n);
|
||||
if(bound == prime_list + 28)
|
||||
bound--;
|
||||
return *bound;
|
||||
}
|
||||
|
||||
// no throw
|
||||
inline std::size_t prev_prime(std::size_t n) {
|
||||
std::size_t const* const prime_list_end = prime_list +
|
||||
sizeof(prime_list) / sizeof(*prime_list);
|
||||
std::size_t const* bound =
|
||||
std::upper_bound(prime_list,prime_list_end, n);
|
||||
std::upper_bound(prime_list,prime_list + 28, n);
|
||||
if(bound != prime_list)
|
||||
bound--;
|
||||
return *bound;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,8 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/unordered/detail/hash_table.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -294,6 +294,7 @@ namespace boost
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
|
||||
const_local_iterator cbegin(size_type n) const
|
||||
{
|
||||
return const_local_iterator(base.begin(n));
|
||||
@@ -303,6 +304,7 @@ namespace boost
|
||||
{
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
#endif
|
||||
|
||||
// hash policy
|
||||
|
||||
@@ -325,21 +327,6 @@ namespace boost
|
||||
{
|
||||
base.rehash(n);
|
||||
}
|
||||
|
||||
friend bool operator==(unordered_map const& m1, unordered_map const& m2)
|
||||
{
|
||||
return m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend bool operator!=(unordered_map const& m1, unordered_map const& m2)
|
||||
{
|
||||
return !m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend std::size_t hash_value(unordered_map const& m)
|
||||
{
|
||||
return m.base.hash_value();
|
||||
}
|
||||
}; // class template unordered_map
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@@ -606,6 +593,7 @@ namespace boost
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
|
||||
const_local_iterator cbegin(size_type n) const
|
||||
{
|
||||
return const_local_iterator(base.begin(n));
|
||||
@@ -615,6 +603,7 @@ namespace boost
|
||||
{
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
#endif
|
||||
|
||||
// hash policy
|
||||
|
||||
@@ -637,21 +626,6 @@ namespace boost
|
||||
{
|
||||
base.rehash(n);
|
||||
}
|
||||
|
||||
friend bool operator==(unordered_multimap const& m1, unordered_multimap const& m2)
|
||||
{
|
||||
return m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend bool operator!=(unordered_multimap const& m1, unordered_multimap const& m2)
|
||||
{
|
||||
return !m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend std::size_t hash_value(unordered_multimap const& m)
|
||||
{
|
||||
return m.base.hash_value();
|
||||
}
|
||||
}; // class template unordered_multimap
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/unordered/detail/hash_table.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -264,6 +264,7 @@ namespace boost
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
|
||||
const_local_iterator cbegin(size_type n) const
|
||||
{
|
||||
return const_local_iterator(base.begin(n));
|
||||
@@ -273,6 +274,7 @@ namespace boost
|
||||
{
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
#endif
|
||||
|
||||
// hash policy
|
||||
|
||||
@@ -295,21 +297,6 @@ namespace boost
|
||||
{
|
||||
base.rehash(n);
|
||||
}
|
||||
|
||||
friend bool operator==(unordered_set const& m1, unordered_set const& m2)
|
||||
{
|
||||
return m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend bool operator!=(unordered_set const& m1, unordered_set const& m2)
|
||||
{
|
||||
return !m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend std::size_t hash_value(unordered_set const& m)
|
||||
{
|
||||
return m.base.hash_value();
|
||||
}
|
||||
}; // class template unordered_set
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@@ -561,6 +548,7 @@ namespace boost
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_LOCAL_CBEGIN)
|
||||
const_local_iterator cbegin(size_type n) const
|
||||
{
|
||||
return const_local_iterator(base.begin(n));
|
||||
@@ -570,6 +558,7 @@ namespace boost
|
||||
{
|
||||
return const_local_iterator(base.end(n));
|
||||
}
|
||||
#endif
|
||||
|
||||
// hash policy
|
||||
|
||||
@@ -592,21 +581,6 @@ namespace boost
|
||||
{
|
||||
base.rehash(n);
|
||||
}
|
||||
|
||||
friend bool operator==(unordered_multiset const& m1, unordered_multiset const& m2)
|
||||
{
|
||||
return m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend bool operator!=(unordered_multiset const& m1, unordered_multiset const& m2)
|
||||
{
|
||||
return !m1.base.equals(m2.base);
|
||||
}
|
||||
|
||||
friend std::size_t hash_value(unordered_multiset const& m)
|
||||
{
|
||||
return m.base.hash_value();
|
||||
}
|
||||
}; // class template unordered_multiset
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
|
||||
Reference in New Issue
Block a user