|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50451 - in branches/release: . boost/config/compiler boost/unordered boost/unordered/detail libs/config/doc libs/config/doc/html libs/config/doc/html/boost_config libs/config/test libs/config/test/all libs/unordered/doc libs/unordered/test/unordered
From: daniel_james_at_[hidden]
Date: 2009-01-03 18:18:36
Author: danieljames
Date: 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
New Revision: 50451
URL: http://svn.boost.org/trac/boost/changeset/50451
Log:
Merge latest hash and unordered developments, and add support for initialiser
lists to config.
Merged revisions 49338,49924-49927,49955,50029,50118 via svnmerge from
https://svn.boost.org/svn/boost/trunk
........
r49338 | danieljames | 2008-10-15 10:44:41 +0100 (Wed, 15 Oct 2008) | 2 lines
Revert [49229], it fixes the same problem as [48674].
........
r49924 | danieljames | 2008-11-24 22:55:14 +0000 (Mon, 24 Nov 2008) | 1 line
Extra tests for equality with different hash functions.
........
r49925 | danieljames | 2008-11-24 22:55:47 +0000 (Mon, 24 Nov 2008) | 1 line
Document operator==/operator!= as undefined if the equality predicates aren't equivalent.
........
r49926 | danieljames | 2008-11-24 22:56:04 +0000 (Mon, 24 Nov 2008) | 1 line
Use a larger prime number list.
........
r49927 | danieljames | 2008-11-24 23:15:55 +0000 (Mon, 24 Nov 2008) | 1 line
Use aligned storage for the value.
........
r49955 | danieljames | 2008-11-27 11:42:13 +0000 (Thu, 27 Nov 2008) | 1 line
Wild stab at getting destruction working on more compilers.
........
r50029 | danieljames | 2008-11-29 21:47:55 +0000 (Sat, 29 Nov 2008) | 1 line
Workaround another in-place destruction.
........
r50118 | danieljames | 2008-12-04 21:30:19 +0000 (Thu, 04 Dec 2008) | 1 line
Add support for initializer lists to config and the unordered containers.
........
Added:
branches/release/libs/config/test/boost_no_initializer_lists.ipp
- copied unchanged from r50118, /trunk/libs/config/test/boost_no_initializer_lists.ipp
branches/release/libs/config/test/no_initializer_lists_fail.cpp
- copied unchanged from r50118, /trunk/libs/config/test/no_initializer_lists_fail.cpp
branches/release/libs/config/test/no_initializer_lists_pass.cpp
- copied unchanged from r50118, /trunk/libs/config/test/no_initializer_lists_pass.cpp
Properties modified:
branches/release/ (props changed)
Text files modified:
branches/release/boost/config/compiler/borland.hpp | 2
branches/release/boost/config/compiler/common_edg.hpp | 5
branches/release/boost/config/compiler/digitalmars.hpp | 1
branches/release/boost/config/compiler/gcc.hpp | 4
branches/release/boost/config/compiler/metrowerks.hpp | 1
branches/release/boost/config/compiler/mpw.hpp | 2
branches/release/boost/config/compiler/pgi.hpp | 1
branches/release/boost/config/compiler/sgi_mipspro.hpp | 2
branches/release/boost/config/compiler/sunpro_cc.hpp | 1
branches/release/boost/config/compiler/vacpp.hpp | 1
branches/release/boost/config/compiler/visualc.hpp | 4
branches/release/boost/unordered/detail/hash_table.hpp | 13 +
branches/release/boost/unordered/detail/hash_table_impl.hpp | 211 ++++++++++++---------------------------
branches/release/boost/unordered/unordered_map.hpp | 36 ++++++
branches/release/boost/unordered/unordered_set.hpp | 36 ++++++
branches/release/libs/config/doc/html/boost_config/acknowledgements.html | 6
branches/release/libs/config/doc/html/boost_config/boost_macro_reference.html | 35 ++++--
branches/release/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html | 12 +-
branches/release/libs/config/doc/html/boost_config/rationale.html | 8
branches/release/libs/config/doc/html/index.html | 38 +++---
branches/release/libs/config/doc/macro_reference.qbk | 3
branches/release/libs/config/test/all/Jamfile.v2 | 5
branches/release/libs/config/test/config_info.cpp | 2
branches/release/libs/config/test/config_test.cpp | 12 ++
branches/release/libs/unordered/doc/changes.qbk | 16 +++
branches/release/libs/unordered/doc/hash_equality.qbk | 10 +
branches/release/libs/unordered/doc/ref.xml | 16 +++
branches/release/libs/unordered/test/unordered/assign_tests.cpp | 16 +++
branches/release/libs/unordered/test/unordered/constructor_tests.cpp | 11 ++
branches/release/libs/unordered/test/unordered/equality_tests.cpp | 25 ++++
30 files changed, 339 insertions(+), 196 deletions(-)
Modified: branches/release/boost/config/compiler/borland.hpp
==============================================================================
--- branches/release/boost/config/compiler/borland.hpp (original)
+++ branches/release/boost/config/compiler/borland.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -158,6 +158,8 @@
# #endif //__BORLANDC__ >= 0x610
#endif
+#define BOOST_NO_INITIALIZER_LISTS
+
#if __BORLANDC__ >= 0x590
# define BOOST_HAS_TR1_HASH
Modified: branches/release/boost/config/compiler/common_edg.hpp
==============================================================================
--- branches/release/boost/config/compiler/common_edg.hpp (original)
+++ branches/release/boost/config/compiler/common_edg.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -43,6 +43,11 @@
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#endif
+#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
+// No support for initializer lists
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
// See also kai.hpp which checks a Kai-specific symbol for EH
# if !defined(__KCC) && !defined(__EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
Modified: branches/release/boost/config/compiler/digitalmars.hpp
==============================================================================
--- branches/release/boost/config/compiler/digitalmars.hpp (original)
+++ branches/release/boost/config/compiler/digitalmars.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -26,6 +26,7 @@
#define BOOST_NO_SFINAE
#define BOOST_NO_USING_TEMPLATE
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: branches/release/boost/config/compiler/gcc.hpp
==============================================================================
--- branches/release/boost/config/compiler/gcc.hpp (original)
+++ branches/release/boost/config/compiler/gcc.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -116,6 +116,10 @@
# endif
#endif
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
//
// Potential C++0x features
//
Modified: branches/release/boost/config/compiler/metrowerks.hpp
==============================================================================
--- branches/release/boost/config/compiler/metrowerks.hpp (original)
+++ branches/release/boost/config/compiler/metrowerks.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -42,6 +42,7 @@
# if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_IS_ABSTRACT
+# define BOOST_NO_INITIALIZER_LISTS
# endif
#if !__option(wchar_type)
Modified: branches/release/boost/config/compiler/mpw.hpp
==============================================================================
--- branches/release/boost/config/compiler/mpw.hpp (original)
+++ branches/release/boost/config/compiler/mpw.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -32,6 +32,8 @@
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
+
+# define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: branches/release/boost/config/compiler/pgi.hpp
==============================================================================
--- branches/release/boost/config/compiler/pgi.hpp (original)
+++ branches/release/boost/config/compiler/pgi.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -21,6 +21,7 @@
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_SWPRINTF
+#define BOOST_NO_INITIALIZER_LISTS
#else
Modified: branches/release/boost/config/compiler/sgi_mipspro.hpp
==============================================================================
--- branches/release/boost/config/compiler/sgi_mipspro.hpp (original)
+++ branches/release/boost/config/compiler/sgi_mipspro.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -21,6 +21,8 @@
#undef BOOST_NO_SWPRINTF
#undef BOOST_DEDUCED_TYPENAME
+
+#define BOOST_NO_INITIALIZER_LISTS
//
// version check:
// probably nothing to do here?
Modified: branches/release/boost/config/compiler/sunpro_cc.hpp
==============================================================================
--- branches/release/boost/config/compiler/sunpro_cc.hpp (original)
+++ branches/release/boost/config/compiler/sunpro_cc.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -74,6 +74,7 @@
//
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_ADL_BARRIER
+#define BOOST_NO_INITIALIZER_LISTS
#if(__SUNPRO_CC >= 0x590)
# define BOOST_HAS_LONG_LONG
Modified: branches/release/boost/config/compiler/vacpp.hpp
==============================================================================
--- branches/release/boost/config/compiler/vacpp.hpp (original)
+++ branches/release/boost/config/compiler/vacpp.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -27,6 +27,7 @@
#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+# define BOOST_NO_INITIALIZER_LISTS
#endif
//
Modified: branches/release/boost/config/compiler/visualc.hpp
==============================================================================
--- branches/release/boost/config/compiler/visualc.hpp (original)
+++ branches/release/boost/config/compiler/visualc.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -88,6 +88,10 @@
# define BOOST_NO_ADL_BARRIER
#endif
+#if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
+# define BOOST_NO_INITIALIZER_LISTS
+#endif
+
#ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
Modified: branches/release/boost/unordered/detail/hash_table.hpp
==============================================================================
--- branches/release/boost/unordered/detail/hash_table.hpp (original)
+++ branches/release/boost/unordered/detail/hash_table.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -26,6 +26,8 @@
#include <boost/static_assert.hpp>
#include <boost/unordered/detail/allocator_helpers.hpp>
#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/aligned_storage.hpp>
+#include <boost/type_traits/alignment_of.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/detail/workaround.hpp>
@@ -76,8 +78,9 @@
template<typename T>
std::size_t const prime_list_template<T>::value[] = {
- 53ul, 97ul, 193ul, 389ul, 769ul,
- 1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
+ 5ul, 11ul, 17ul, 29ul, 37ul, 53ul, 67ul, 79ul,
+ 97ul, 131ul, 193ul, 257ul, 389ul, 521ul, 769ul,
+ 1031ul, 1543ul, 2053ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
@@ -220,7 +223,11 @@
functions func2_;
functions_ptr func_; // The currently active functions.
};
-
+
+ template <typename T>
+ void destroy(T* x) {
+ x->~T();
+ }
}
}
Modified: branches/release/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/release/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/release/boost/unordered/detail/hash_table_impl.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -34,7 +34,6 @@
public:
typedef BOOST_UNORDERED_TABLE_DATA data;
- struct node_base;
struct node;
struct bucket;
typedef std::size_t size_type;
@@ -46,9 +45,6 @@
boost::unordered_detail::rebind_wrap<Alloc, node>::type
node_allocator;
typedef BOOST_DEDUCED_TYPENAME
- boost::unordered_detail::rebind_wrap<Alloc, node_base>::type
- node_base_allocator;
- typedef BOOST_DEDUCED_TYPENAME
boost::unordered_detail::rebind_wrap<Alloc, bucket>::type
bucket_allocator;
@@ -88,39 +84,36 @@
}
};
+ // Value Base
+
+ struct value_base {
+ typename boost::aligned_storage<
+ sizeof(value_type),
+ boost::alignment_of<value_type>::value>::type data_;
+
+ void* address() { return this; }
+ };
+
// Hash Node
//
// all no throw
- struct node_base : bucket
- {
+ struct node : value_base, bucket {
#if BOOST_UNORDERED_EQUIVALENT_KEYS
public:
- node_base() : group_prev_()
+ node() : group_prev_()
{
BOOST_UNORDERED_MSVC_RESET_PTR(group_prev_);
}
link_ptr group_prev_;
#endif
- };
- struct node : node_base
- {
- public:
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
- template <typename... Args>
- node(Args&&... args)
- : node_base(), value_(std::forward<Args>(args)...) {}
-#else
- node(value_type const& v) : node_base(), value_(v) {}
-#endif
-
- value_type value_;
+ value_type& value() {
+ return *static_cast<value_type*>(this->address());
+ }
};
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
-
// allocators
//
// Stores all the allocators that we're going to need.
@@ -136,7 +129,9 @@
void destroy(link_ptr ptr)
{
- node_ptr n(node_alloc_.address(*static_cast<node*>(&*ptr)));
+ node* raw_ptr = static_cast<node*>(&*ptr);
+ boost::unordered_detail::destroy(&raw_ptr->value());
+ node_ptr n(node_alloc_.address(*raw_ptr));
node_alloc_.destroy(n);
node_alloc_.deallocate(n, 1);
}
@@ -163,146 +158,62 @@
node_ptr node_;
bool node_constructed_;
+ bool value_constructed_;
public:
node_constructor(allocators& a)
: allocators_(a),
- node_(), node_constructed_(false)
+ node_(), node_constructed_(false), value_constructed_(false)
{
}
~node_constructor()
{
if (node_) {
+ if (value_constructed_) {
+ boost::unordered_detail::destroy(&node_->value());
+ }
+
if (node_constructed_)
allocators_.node_alloc_.destroy(node_);
allocators_.node_alloc_.deallocate(node_, 1);
}
}
+#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
template <typename... Args>
void construct(Args&&... args)
{
BOOST_ASSERT(!node_);
node_constructed_ = false;
+ value_constructed_ = false;
node_ = allocators_.node_alloc_.allocate(1);
- allocators_.node_alloc_.construct(node_, std::forward<Args>(args)...);
- node_constructed_ = true;
- }
- node_ptr get() const
- {
- BOOST_ASSERT(node_);
- return node_;
- }
+ allocators_.node_alloc_.construct(node_, node());
+ node_constructed_ = true;
- // no throw
- link_ptr release()
- {
- node_ptr p = node_;
- unordered_detail::reset(node_);
- return link_ptr(allocators_.bucket_alloc_.address(*p));
+ new(node_->address()) value_type(std::forward<Args>(args)...);
+ value_constructed_ = true;
}
-
- private:
- node_constructor(node_constructor const&);
- node_constructor& operator=(node_constructor const&);
- };
#else
-
- // allocators
- //
- // Stores all the allocators that we're going to need.
-
- struct allocators
- {
- node_allocator node_alloc_;
- bucket_allocator bucket_alloc_;
- value_allocator value_alloc_;
- node_base_allocator node_base_alloc_;
-
- allocators(value_allocator const& a)
- : node_alloc_(a), bucket_alloc_(a),
- value_alloc_(a), node_base_alloc_(a)
- {}
-
- void destroy(link_ptr ptr)
- {
- node_ptr n(node_alloc_.address(*static_cast<node*>(&*ptr)));
- value_alloc_.destroy(value_alloc_.address(n->value_));
- node_base_alloc_.destroy(node_base_alloc_.address(*n));
- node_alloc_.deallocate(n, 1);
- }
-
- void swap(allocators& x)
- {
- boost::swap(node_alloc_, x.node_alloc_);
- boost::swap(bucket_alloc_, x.bucket_alloc_);
- boost::swap(value_alloc_, x.value_alloc_);
- boost::swap(node_base_alloc_, x.node_base_alloc_);
- }
-
- bool operator==(allocators const& x)
- {
- return value_alloc_ == x.value_alloc_;
- }
- };
-
- // node_constructor
- //
- // Used to construct nodes in an exception safe manner.
-
- class node_constructor
- {
- allocators& allocators_;
-
- node_ptr node_;
- bool value_constructed_;
- bool node_base_constructed_;
-
- public:
-
- node_constructor(allocators& a)
- : allocators_(a),
- node_(), value_constructed_(false), node_base_constructed_(false)
- {
- BOOST_UNORDERED_MSVC_RESET_PTR(node_);
- }
-
- ~node_constructor()
- {
- if (node_) {
- if (value_constructed_)
- allocators_.value_alloc_.destroy(
- allocators_.value_alloc_.address(node_->value_));
- if (node_base_constructed_)
- allocators_.node_base_alloc_.destroy(
- allocators_.node_base_alloc_.address(*node_));
-
- allocators_.node_alloc_.deallocate(node_, 1);
- }
- }
-
template <typename V>
void construct(V const& v)
{
BOOST_ASSERT(!node_);
+ node_constructed_ = false;
value_constructed_ = false;
- node_base_constructed_ = false;
node_ = allocators_.node_alloc_.allocate(1);
- allocators_.node_base_alloc_.construct(
- allocators_.node_base_alloc_.address(*node_),
- node_base());
- node_base_constructed_ = true;
+ allocators_.node_alloc_.construct(node_, node());
+ node_constructed_ = true;
- allocators_.value_alloc_.construct(
- allocators_.value_alloc_.address(node_->value_), v);
+ new(node_->address()) value_type(v);
value_constructed_ = true;
}
+#endif
node_ptr get() const
{
@@ -322,7 +233,6 @@
node_constructor(node_constructor const&);
node_constructor& operator=(node_constructor const&);
};
-#endif
// Methods for navigating groups of elements with equal keys.
@@ -351,8 +261,7 @@
// pre: Must be pointing to a node
static inline reference get_value(link_ptr p) {
- BOOST_ASSERT(p);
- return static_cast<node*>(&*p)->value_;
+ return get_node(p).value();
}
class iterator_base
@@ -1357,17 +1266,10 @@
// accessors
// no throw
-#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)
node_allocator get_allocator() const
{
return data_.allocators_.node_alloc_;
}
-#else
- value_allocator get_allocator() const
- {
- return data_.allocators_.value_alloc_;
- }
-#endif
// no throw
hasher const& hash_function() const
@@ -1469,6 +1371,21 @@
return need_to_reserve;
}
+ // basic exception safety
+ bool reserve_for_insert(size_type n)
+ {
+ bool need_to_reserve = n >= max_load_;
+ // throws - basic:
+ if (need_to_reserve) {
+ size_type s = size();
+ s = s + (s >> 1);
+ s = s > n ? s : n;
+ rehash_impl(min_buckets_for_size(s));
+ }
+ BOOST_ASSERT(n < max_load_ || n > max_size());
+ return need_to_reserve;
+ }
+
public:
// no throw
@@ -1713,14 +1630,14 @@
iterator_base insert_impl(node_constructor& a)
{
- key_type const& k = extract_key(a.get()->value_);
+ key_type const& k = extract_key(a.get()->value());
size_type hash_value = hash_function()(k);
bucket_ptr bucket = data_.bucket_ptr_from_hash(hash_value);
link_ptr position = find_iterator(bucket, k);
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- if(reserve(size() + 1))
+ if(reserve_for_insert(size() + 1))
bucket = data_.bucket_ptr_from_hash(hash_value);
// I'm relying on link_ptr not being invalidated by
@@ -1735,7 +1652,7 @@
iterator_base insert_hint_impl(iterator_base const& it, node_constructor& a)
{
// equal can throw, but with no effects
- if (it == data_.end() || !equal(extract_key(a.get()->value_), *it)) {
+ if (it == data_.end() || !equal(extract_key(a.get()->value()), *it)) {
// Use the standard insert if the iterator doesn't point
// to a matching key.
return insert_impl(a);
@@ -1750,8 +1667,8 @@
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- bucket_ptr base = reserve(size() + 1) ?
- get_bucket(extract_key(a.get()->value_)) : it.bucket_;
+ bucket_ptr base = reserve_for_insert(size() + 1) ?
+ get_bucket(extract_key(a.get()->value())) : it.bucket_;
// Nothing after this point can throw
@@ -1775,13 +1692,13 @@
}
else {
// Only require basic exception safety here
- reserve(size() + distance);
+ reserve_for_insert(size() + distance);
node_constructor a(data_.allocators_);
for (; i != j; ++i) {
a.construct(*i);
- key_type const& k = extract_key(a.get()->value_);
+ key_type const& k = extract_key(a.get()->value());
bucket_ptr bucket = get_bucket(k);
link_ptr position = find_iterator(bucket, k);
@@ -1841,7 +1758,7 @@
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- if(reserve(size() + 1))
+ if(reserve_for_insert(size() + 1))
bucket = data_.bucket_ptr_from_hash(hash_value);
// Nothing after this point can throw.
@@ -1880,7 +1797,7 @@
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- if(reserve(size() + 1))
+ if(reserve_for_insert(size() + 1))
bucket = data_.bucket_ptr_from_hash(hash_value);
// Nothing after this point can throw.
@@ -1947,7 +1864,7 @@
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- if(reserve(size() + 1))
+ if(reserve_for_insert(size() + 1))
bucket = data_.bucket_ptr_from_hash(hash_value);
// Nothing after this point can throw.
@@ -1966,7 +1883,7 @@
a.construct(std::forward<Args>(args)...);
// No side effects in this initial code
- key_type const& k = extract_key(a.get()->value_);
+ key_type const& k = extract_key(a.get()->value());
size_type hash_value = hash_function()(k);
bucket_ptr bucket = data_.bucket_ptr_from_hash(hash_value);
link_ptr pos = find_iterator(bucket, k);
@@ -1978,7 +1895,7 @@
} else {
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
- if(reserve(size() + 1))
+ if(reserve_for_insert(size() + 1))
bucket = data_.bucket_ptr_from_hash(hash_value);
// Nothing after this point can throw.
@@ -2047,7 +1964,7 @@
// reserve has basic exception safety if the hash function
// throws, strong otherwise.
if(size() + 1 >= max_load_) {
- reserve(size() + insert_size(i, j));
+ reserve_for_insert(size() + insert_size(i, j));
bucket = data_.bucket_ptr_from_hash(hash_value);
}
Modified: branches/release/boost/unordered/unordered_map.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_map.hpp (original)
+++ branches/release/boost/unordered/unordered_map.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -135,6 +135,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_map(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_map& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -523,6 +541,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_multimap(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_multimap& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
Modified: branches/release/boost/unordered/unordered_set.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_set.hpp (original)
+++ branches/release/boost/unordered/unordered_set.hpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -133,6 +133,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_set(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_set& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
@@ -493,6 +511,24 @@
#endif
#endif
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+ unordered_multiset(std::initializer_list<value_type> list,
+ size_type n = boost::unordered_detail::default_initial_bucket_count,
+ const hasher &hf = hasher(),
+ const key_equal &eql = key_equal(),
+ const allocator_type &a = allocator_type())
+ : base(list.begin(), list.end(), n, hf, eql, a)
+ {
+ }
+
+ unordered_multiset& operator=(std::initializer_list<value_type> list)
+ {
+ base.data_.clear();
+ base.insert_range(list.begin(), list.end());
+ return *this;
+ }
+#endif
+
private:
BOOST_DEDUCED_TYPENAME implementation::iterator_base const&
Modified: branches/release/libs/config/doc/html/boost_config/acknowledgements.html
==============================================================================
--- branches/release/libs/config/doc/html/boost_config/acknowledgements.html (original)
+++ branches/release/libs/config/doc/html/boost_config/acknowledgements.html 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Acknowledgements</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="rationale.html" title="Rationale">
@@ -23,14 +23,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_config.acknowledgements"></a>Acknowledgements
+<a name="boost_config.acknowledgements"></a><a class="link" href="acknowledgements.html" title="Acknowledgements">Acknowledgements</a>
</h2></div></div></div>
<p>
Beman Dawes provided the original <code class="computeroutput"><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span></code> and
part of this document.
</p>
<p>
- Vesa Karvonen provided a description of the principles (see rationale)
+ Vesa Karvonen provided a description of the principles (see <a class="link" href="rationale.html" title="Rationale">rationale</a>)
and put together an early version of the current configuration setup.
</p>
<p>
Modified: branches/release/libs/config/doc/html/boost_config/boost_macro_reference.html
==============================================================================
--- branches/release/libs/config/doc/html/boost_config/boost_macro_reference.html (original)
+++ branches/release/libs/config/doc/html/boost_config/boost_macro_reference.html 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost Macro Reference</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="../index.html" title="Boost.Config">
@@ -24,7 +24,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_config.boost_macro_reference"></a>Boost Macro Reference
+<a name="boost_config.boost_macro_reference"></a><a class="link" href="boost_macro_reference.html" title="Boost Macro Reference">Boost Macro Reference</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_defects">Macros
@@ -46,7 +46,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.macros_that_describe_defects"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_defects" title="Macros that describe defects">Macros
+<a name="boost_config.boost_macro_reference.macros_that_describe_defects"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_defects" title="Macros that describe defects">Macros
that describe defects</a>
</h3></div></div></div>
<p>
@@ -1258,7 +1258,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.macros_that_describe_optional_features"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_optional_features" title="Macros that describe optional features">Macros
+<a name="boost_config.boost_macro_reference.macros_that_describe_optional_features"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_optional_features" title="Macros that describe optional features">Macros
that describe optional features</a>
</h3></div></div></div>
<p>
@@ -2166,7 +2166,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.macros_that_describe_possible_c__0x_features"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_possible_c__0x_features" title="Macros that describe possible C++0x features">Macros
+<a name="boost_config.boost_macro_reference.macros_that_describe_possible_c__0x_features"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_possible_c__0x_features" title="Macros that describe possible C++0x features">Macros
that describe possible C++0x features</a>
</h3></div></div></div>
<p>
@@ -2207,7 +2207,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.macros_that_describe_c__0x_features_not_supported"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__0x_features_not_supported" title="Macros that describe C++0x features not supported">Macros
+<a name="boost_config.boost_macro_reference.macros_that_describe_c__0x_features_not_supported"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__0x_features_not_supported" title="Macros that describe C++0x features not supported">Macros
that describe C++0x features not supported</a>
</h3></div></div></div>
<p>
@@ -2336,6 +2336,19 @@
<tr>
<td>
<p>
+ <code class="computeroutput"><span class="identifier">BOOST_NO_INITIALIZER_LISTS</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The C++ compiler does not support C++0x initializer lists.
+ </p>
+ </td>
+<td class="auto-generated"> </td>
+</tr>
+<tr>
+<td>
+ <p>
<code class="computeroutput"><span class="identifier">BOOST_NO_LONG_LONG</span></code>
</p>
</td>
@@ -2425,7 +2438,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.boost_helper_macros"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.boost_helper_macros" title="Boost Helper Macros">Boost
+<a name="boost_config.boost_macro_reference.boost_helper_macros"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.boost_helper_macros" title="Boost Helper Macros">Boost
Helper Macros</a>
</h3></div></div></div>
<p>
@@ -2718,7 +2731,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.boost_informational_macros"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.boost_informational_macros" title="Boost Informational Macros">Boost
+<a name="boost_config.boost_macro_reference.boost_informational_macros"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.boost_informational_macros" title="Boost Informational Macros">Boost
Informational Macros</a>
</h3></div></div></div>
<p>
@@ -2957,7 +2970,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code" title="Macros for libraries with separate source code">Macros
+<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code" title="Macros for libraries with separate source code">Macros
for libraries with separate source code</a>
</h3></div></div></div>
<div class="toc"><dl>
@@ -2974,7 +2987,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing" title="ABI Fixing">ABI
+<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.abi_fixing" title="ABI Fixing">ABI
Fixing</a>
</h4></div></div></div>
<p>
@@ -3032,7 +3045,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.automatic_library_selection"></a><a href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.automatic_library_selection" title="Automatic library selection">Automatic
+<a name="boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.automatic_library_selection"></a><a class="link" href="boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code.automatic_library_selection" title="Automatic library selection">Automatic
library selection</a>
</h4></div></div></div>
<p>
Modified: branches/release/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html
==============================================================================
--- branches/release/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html (original)
+++ branches/release/libs/config/doc/html/boost_config/guidelines_for_boost_authors.html 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Guidelines for Boost Authors</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="boost_macro_reference.html" title="Boost Macro Reference">
@@ -24,7 +24,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_config.guidelines_for_boost_authors"></a><a href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">Guidelines for
+<a name="boost_config.guidelines_for_boost_authors"></a><a class="link" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">Guidelines for
Boost Authors</a>
</h2></div></div></div>
<div class="toc"><dl>
@@ -105,7 +105,7 @@
</ul></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.guidelines_for_boost_authors.warnings"></a><a href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.warnings" title="Disabling Compiler Warnings">
+<a name="boost_config.guidelines_for_boost_authors.warnings"></a><a class="link" href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.warnings" title="Disabling Compiler Warnings">
Disabling Compiler Warnings</a>
</h3></div></div></div>
<p>
@@ -184,7 +184,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.guidelines_for_boost_authors.adding_new_defect_macros"></a><a href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.adding_new_defect_macros" title="Adding New Defect Macros">Adding
+<a name="boost_config.guidelines_for_boost_authors.adding_new_defect_macros"></a><a class="link" href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.adding_new_defect_macros" title="Adding New Defect Macros">Adding
New Defect Macros</a>
</h3></div></div></div>
<p>
@@ -283,7 +283,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.guidelines_for_boost_authors.adding_new_feature_test_macros"></a><a href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.adding_new_feature_test_macros" title="Adding New Feature Test Macros">Adding
+<a name="boost_config.guidelines_for_boost_authors.adding_new_feature_test_macros"></a><a class="link" href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.adding_new_feature_test_macros" title="Adding New Feature Test Macros">Adding
New Feature Test Macros</a>
</h3></div></div></div>
<p>
@@ -307,7 +307,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.guidelines_for_boost_authors.modifying_the_boost_configuration_headers"></a><a href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.modifying_the_boost_configuration_headers" title="Modifying the Boost Configuration Headers">Modifying
+<a name="boost_config.guidelines_for_boost_authors.modifying_the_boost_configuration_headers"></a><a class="link" href="guidelines_for_boost_authors.html#boost_config.guidelines_for_boost_authors.modifying_the_boost_configuration_headers" title="Modifying the Boost Configuration Headers">Modifying
the Boost Configuration Headers</a>
</h3></div></div></div>
<p>
Modified: branches/release/libs/config/doc/html/boost_config/rationale.html
==============================================================================
--- branches/release/libs/config/doc/html/boost_config/rationale.html (original)
+++ branches/release/libs/config/doc/html/boost_config/rationale.html 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Rationale</title>
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../index.html" title="Boost.Config">
<link rel="up" href="../index.html" title="Boost.Config">
<link rel="prev" href="guidelines_for_boost_authors.html" title="Guidelines for Boost Authors">
@@ -24,7 +24,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_config.rationale"></a>Rationale
+<a name="boost_config.rationale"></a><a class="link" href="rationale.html" title="Rationale">Rationale</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section">The problem</span></dt>
@@ -41,7 +41,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.rationale.the_problem"></a>The problem
+<a name="boost_config.rationale.the_problem"></a><a class="link" href="rationale.html#boost_config.rationale.the_problem" title="The problem">The problem</a>
</h3></div></div></div>
<p>
Consider a situation in which you are concurrently developing on multiple
@@ -104,7 +104,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.rationale.the_solution"></a>The solution
+<a name="boost_config.rationale.the_solution"></a><a class="link" href="rationale.html#boost_config.rationale.the_solution" title="The solution">The solution</a>
</h3></div></div></div>
<p>
The approach taken by boost's configuration headers is to separate configuration
Modified: branches/release/libs/config/doc/html/index.html
==============================================================================
--- branches/release/libs/config/doc/html/index.html (original)
+++ branches/release/libs/config/doc/html/index.html 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Config</title>
<link rel="stylesheet" href="../../../../doc/html/boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Boost.Config">
<link rel="next" href="boost_config/boost_macro_reference.html" title="Boost Macro Reference">
</head>
@@ -28,7 +28,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright © 2001 -2007 Beman Dawes, Vesa Karvonen, John Maddock</p></div>
<div><div class="legalnotice">
-<a name="id445670"></a><p>
+<a name="id2998570"></a><p>
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)
</p>
@@ -94,7 +94,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="boost_config.configuring_boost_for_your_platform"></a><a href="index.html#boost_config.configuring_boost_for_your_platform" title="Configuring Boost for Your Platform">Configuring
+<a name="boost_config.configuring_boost_for_your_platform"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform" title="Configuring Boost for Your Platform">Configuring
Boost for Your Platform</a>
</h2></div></div></div>
<div class="toc"><dl>
@@ -113,7 +113,7 @@
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.using_the_default_boost_configuration"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.using_the_default_boost_configuration" title="Using the default boost configuration">Using
+<a name="boost_config.configuring_boost_for_your_platform.using_the_default_boost_configuration"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.using_the_default_boost_configuration" title="Using the default boost configuration">Using
the default boost configuration</a>
</h3></div></div></div>
<p>
@@ -137,7 +137,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.the__boost_config_hpp__header"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.the__boost_config_hpp__header" title="The <boost/config.hpp> header">The
+<a name="boost_config.configuring_boost_for_your_platform.the__boost_config_hpp__header"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.the__boost_config_hpp__header" title="The <boost/config.hpp> header">The
<boost/config.hpp> header</a>
</h3></div></div></div>
<p>
@@ -152,10 +152,10 @@
them usable by both Boost library and user code.
</p>
<p>
- Boost informational or helper
+ Boost <a class="link" href="boost_config/boost_macro_reference.html#config_info_macros">informational</a> or <a class="link" href="boost_config/boost_macro_reference.html#config_helpers">helper</a>
macros are designed for use by Boost users as well as for our own internal
- use. Note however, that the feature test
- and defect test macros were designed
+ use. Note however, that the <a class="link" href="boost_config/boost_macro_reference.html#config_features">feature test</a>
+ and <a class="link" href="boost_config/boost_macro_reference.html#config_defects">defect test</a> macros were designed
for internal use by Boost libraries, not user code, so they can change at
any time (though no gratuitous changes are made to them). Boost library problems
resulting from changes to the configuration macros are caught by the Boost
@@ -170,7 +170,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.using_the_configure_script"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.using_the_configure_script" title="Using the configure script">Using
+<a name="boost_config.configuring_boost_for_your_platform.using_the_configure_script"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.using_the_configure_script" title="Using the configure script">Using
the configure script</a>
</h3></div></div></div>
<div class="important"><table border="0" summary="Important">
@@ -320,7 +320,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.user_settable_options"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.user_settable_options" title="User settable options">User
+<a name="boost_config.configuring_boost_for_your_platform.user_settable_options"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.user_settable_options" title="User settable options">User
settable options</a>
</h3></div></div></div>
<p>
@@ -684,7 +684,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage" title="Advanced configuration usage">Advanced
+<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage" title="Advanced configuration usage">Advanced
configuration usage</a>
</h3></div></div></div>
<div class="toc"><dl>
@@ -709,13 +709,13 @@
<p>
Next the compiler, standard library, and platform configuration files are
included. These are included via macros (<code class="computeroutput"><span class="identifier">BOOST_COMPILER_CONFIG</span></code>
- etc, see user settable macros),
+ etc, <a class="link" href="index.html#config_user_settable">see user settable macros</a>),
and if the corresponding macro is undefined then a separate header that detects
which compiler/standard library/platform is in use is included in order to
set these. The config can be told to ignore these headers altogether if the
corresponding <code class="computeroutput"><span class="identifier">BOOST_NO_XXX</span></code>
macro is set (for example <code class="computeroutput"><span class="identifier">BOOST_NO_COMPILER_CONFIG</span></code>
- to disable including any compiler configuration file - <a href="index.html#config_user_settable">see
+ to disable including any compiler configuration file - <a class="link" href="index.html#config_user_settable">see
user settable macros</a>).
</p>
<p>
@@ -728,7 +728,7 @@
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_1__creating_our_own_frozen_configuration"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_1__creating_our_own_frozen_configuration" title="Example 1, creating our own frozen configuration">Example
+<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_1__creating_our_own_frozen_configuration"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_1__creating_our_own_frozen_configuration" title="Example 1, creating our own frozen configuration">Example
1, creating our own frozen configuration</a>
</h4></div></div></div>
<p>
@@ -760,7 +760,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_2__skipping_files_that_you_don_t_need"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_2__skipping_files_that_you_don_t_need" title="Example 2: skipping files that you don't need">Example
+<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_2__skipping_files_that_you_don_t_need"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_2__skipping_files_that_you_don_t_need" title="Example 2: skipping files that you don't need">Example
2: skipping files that you don't need</a>
</h4></div></div></div>
<p>
@@ -779,20 +779,20 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_3__using_configure_script_to_freeze_the_boost_configuration"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_3__using_configure_script_to_freeze_the_boost_configuration" title="Example 3: using configure script to freeze the boost configuration">Example
+<a name="boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_3__using_configure_script_to_freeze_the_boost_configuration"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.advanced_configuration_usage.example_3__using_configure_script_to_freeze_the_boost_configuration" title="Example 3: using configure script to freeze the boost configuration">Example
3: using configure script to freeze the boost configuration</a>
</h4></div></div></div>
<p>
If you are working on a unix-like platform then you can use the configure
script to generate a "frozen" configuration based on your current
- compiler setup - <a href="index.html#config_config_script">see using the configure
+ compiler setup - <a class="link" href="index.html#config_config_script">see using the configure
script for more details</a>.
</p>
</div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_config.configuring_boost_for_your_platform.testing_the_boost_configuration"></a><a href="index.html#boost_config.configuring_boost_for_your_platform.testing_the_boost_configuration" title="Testing the boost configuration">Testing
+<a name="boost_config.configuring_boost_for_your_platform.testing_the_boost_configuration"></a><a class="link" href="index.html#boost_config.configuring_boost_for_your_platform.testing_the_boost_configuration" title="Testing the boost configuration">Testing
the boost configuration</a>
</h3></div></div></div>
<p>
@@ -960,7 +960,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: October 27, 2008 at 16:15:55 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 03, 2009 at 22:54:59 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: branches/release/libs/config/doc/macro_reference.qbk
==============================================================================
--- branches/release/libs/config/doc/macro_reference.qbk (original)
+++ branches/release/libs/config/doc/macro_reference.qbk 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -547,6 +547,9 @@
[[`BOOST_NO_EXTERN_TEMPLATE`][The compiler does not support
explicit instantiation declarations for templates (`explicit template`).
]]
+[[`BOOST_NO_INITIALIZER_LISTS`][
+The C++ compiler does not support C++0x initializer lists.
+]]
[[`BOOST_NO_LONG_LONG`][The compiler does not support `long long`.
]]
[[`BOOST_NO_RAW_LITERALS`][The compiler does not support
Modified: branches/release/libs/config/test/all/Jamfile.v2
==============================================================================
--- branches/release/libs/config/test/all/Jamfile.v2 (original)
+++ branches/release/libs/config/test/all/Jamfile.v2 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -1,7 +1,7 @@
#
# Regression test Jamfile for boost configuration setup.
# *** DO NOT EDIT THIS FILE BY HAND ***
-# This file was automatically generated on Sat Sep 20 09:49:52 2008
+# This file was automatically generated on Wed Sep 24 11:44:22 2008
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@@ -232,6 +232,9 @@
test-suite "BOOST_NO_MS_INT64_NUMERIC_LIMITS" :
[ run ../no_i64_limits_pass.cpp ]
[ compile-fail ../no_i64_limits_fail.cpp ] ;
+test-suite "BOOST_NO_INITIALIZER_LISTS" :
+[ run ../no_initializer_lists_pass.cpp ]
+[ compile-fail ../no_initializer_lists_fail.cpp ] ;
test-suite "BOOST_NO_INCLASS_MEMBER_INITIALIZATION" :
[ run ../no_inline_memb_init_pass.cpp ]
[ compile-fail ../no_inline_memb_init_fail.cpp ] ;
Modified: branches/release/libs/config/test/config_info.cpp
==============================================================================
--- branches/release/libs/config/test/config_info.cpp (original)
+++ branches/release/libs/config/test/config_info.cpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -969,6 +969,7 @@
PRINT_MACRO(BOOST_NO_FUNCTION_TEMPLATE_ORDERING);
PRINT_MACRO(BOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS);
PRINT_MACRO(BOOST_NO_INCLASS_MEMBER_INITIALIZATION);
+ PRINT_MACRO(BOOST_NO_INITIALIZER_LISTS);
PRINT_MACRO(BOOST_NO_INTEGRAL_INT64_T);
PRINT_MACRO(BOOST_NO_INTRINSIC_WCHAR_T);
PRINT_MACRO(BOOST_NO_IOSFWD);
@@ -1041,6 +1042,7 @@
+
// END GENERATED BLOCK
PRINT_MACRO(BOOST_INTEL);
Modified: branches/release/libs/config/test/config_test.cpp
==============================================================================
--- branches/release/libs/config/test/config_test.cpp (original)
+++ branches/release/libs/config/test/config_test.cpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -1,4 +1,4 @@
-// This file was automatically generated on Sat Sep 20 09:49:52 2008
+// This file was automatically generated on Wed Sep 24 11:44:22 2008
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@@ -117,6 +117,11 @@
#else
namespace boost_no_ms_int64_numeric_limits = empty_boost;
#endif
+#ifndef BOOST_NO_INITIALIZER_LISTS
+#include "boost_no_initializer_lists.ipp"
+#else
+namespace boost_no_initializer_lists = empty_boost;
+#endif
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
#include "boost_no_inline_memb_init.ipp"
#else
@@ -966,6 +971,11 @@
std::cerr << "Failed test for BOOST_NO_MS_INT64_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
+ if(0 != boost_no_initializer_lists::test())
+ {
+ std::cerr << "Failed test for BOOST_NO_INITIALIZER_LISTS at: " << __FILE__ << ":" << __LINE__ << std::endl;
+ ++error_count;
+ }
if(0 != boost_no_inclass_member_initialization::test())
{
std::cerr << "Failed test for BOOST_NO_INCLASS_MEMBER_INITIALIZATION at: " << __FILE__ << ":" << __LINE__ << std::endl;
Modified: branches/release/libs/unordered/doc/changes.qbk
==============================================================================
--- branches/release/libs/unordered/doc/changes.qbk (original)
+++ branches/release/libs/unordered/doc/changes.qbk 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -45,5 +45,21 @@
[h2 Boost 1.38.0]
* Use [@../../libs/utility/swap.html `boost::swap`].
+* [@https://svn.boost.org/trac/boost/ticket/2237 Ticket 2237]:
+ Document that the equality and inequality operators are undefined for two
+ objects if their equality predicates aren't equivalent. Thanks to Daniel
+ Krügler.
+* [@https://svn.boost.org/trac/boost/ticket/1710 Ticket 1710]:
+ Use a larger prime number list. Thanks to Thorsten Ottosen and Hervé
+ Brönnimann.
+* Use
+ [@../../libs/type_traits/doc/html/boost_typetraits/category/alignment.html
+ aligned storage] to store the types. This changes the way the allocator is
+ used to construct nodes. It used to construct the node with two calls to
+ the allocator's `construct` method - once for the pointers and once for the
+ value. It now constructs the node with a single call to construct and
+ then constructs the value using in place construction.
+* Add support for C++0x initializer lists where they're available (currently
+ only g++ 4.4 in C++0x mode).
[endsect]
Modified: branches/release/libs/unordered/doc/hash_equality.qbk
==============================================================================
--- branches/release/libs/unordered/doc/hash_equality.qbk (original)
+++ branches/release/libs/unordered/doc/hash_equality.qbk 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -41,6 +41,16 @@
[@../../libs/unordered/examples/case_insensitive.hpp /libs/unordered/examples/case_insensitive.hpp]
which supports other locales and string types.
+[caution
+Be careful when using the equality (`==`) operator with custom equality
+predicates, especially if you're using a function pointer. If you compare two
+containers with different equality predicates then the result is undefined.
+For most stateless function objects this is impossible - since you can only
+compare objects with the same equality predicate you know the equality
+predicates must be equal. But if you're using function pointers or a stateful
+equality predicate (e.g. boost::function) then you can get into trouble.
+]
+
[h2 Custom Types]
Similarly, a custom hash function can be used for custom types:
Modified: branches/release/libs/unordered/doc/ref.xml
==============================================================================
--- branches/release/libs/unordered/doc/ref.xml (original)
+++ branches/release/libs/unordered/doc/ref.xml 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -678,6 +678,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
<function name="operator!=">
@@ -700,6 +702,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
</free-function-group>
@@ -1406,6 +1410,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
<function name="operator!=">
@@ -1428,6 +1434,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
</free-function-group>
@@ -2185,6 +2193,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
<function name="operator!=">
@@ -2209,6 +2219,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
</free-function-group>
@@ -2927,6 +2939,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
<function name="operator!=">
@@ -2951,6 +2965,8 @@
<type>bool</type>
<notes>
<para>This is a boost extension.</para>
+ <para>Behavior is undefined if the two containers don't have
+ equivalent equality predicates.</para>
</notes>
</function>
</free-function-group>
Modified: branches/release/libs/unordered/test/unordered/assign_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/assign_tests.cpp (original)
+++ branches/release/libs/unordered/test/unordered/assign_tests.cpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -103,6 +103,22 @@
((default_generator)(generate_collisions))
)
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
+UNORDERED_AUTO_TEST(assign_initializer_list)
+{
+ std::cerr<<"Initializer List Tests\n";
+
+ boost::unordered_set<int> x;
+ x.insert(10);
+ x.insert(20);
+ x = { 1, 2, -10 };
+ BOOST_CHECK(x.find(10) == x.end());
+ BOOST_CHECK(x.find(-10) != x.end());
+}
+
+#endif
+
}
RUN_TESTS()
Modified: branches/release/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ branches/release/libs/unordered/test/unordered/constructor_tests.cpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -288,6 +288,17 @@
((test_map)(test_multimap))
)
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
+UNORDERED_AUTO_TEST(test_initializer_list) {
+ std::cerr<<"Initializer List Tests\n";
+ boost::unordered_set<int> x1 = { 2, 10, 45, -5 };
+ BOOST_CHECK(x1.find(10) != x1.end());
+ BOOST_CHECK(x1.find(46) == x1.end());
+}
+
+#endif
+
}
RUN_TESTS()
Modified: branches/release/libs/unordered/test/unordered/equality_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/equality_tests.cpp (original)
+++ branches/release/libs/unordered/test/unordered/equality_tests.cpp 2009-01-03 18:18:33 EST (Sat, 03 Jan 2009)
@@ -13,6 +13,10 @@
{
struct mod_compare
{
+ bool alt_hash_;
+
+ explicit mod_compare(bool alt_hash = false) : alt_hash_(alt_hash) {}
+
bool operator()(int x, int y) const
{
return x % 1000 == y % 1000;
@@ -20,7 +24,7 @@
int operator()(int x) const
{
- return x % 250;
+ return alt_hash_ ? x % 250 : (x + 5) % 250;
}
};
@@ -138,6 +142,25 @@
((1)(2))((1001)(1)), ==, ((1001)(2))((1)(1)));
}
+ // Test that equality still works when the two containers have
+ // different hash functions but the same equality predicate.
+
+ UNORDERED_AUTO_TEST(equality_different_hash_test)
+ {
+ typedef boost::unordered_set<int, mod_compare, mod_compare> set;
+ set set1(0, mod_compare(false), mod_compare(false));
+ set set2(0, mod_compare(true), mod_compare(true));
+ BOOST_CHECK(set1 == set2);
+ set1.insert(1); set2.insert(2);
+ BOOST_CHECK(set1 != set2);
+ set1.insert(2); set2.insert(1);
+ BOOST_CHECK(set1 == set2);
+ set1.insert(10); set2.insert(20);
+ BOOST_CHECK(set1 != set2);
+ set1.insert(20); set2.insert(10);
+ BOOST_CHECK(set1 == set2);
+ }
+
}
RUN_TESTS()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk