|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2007-12-19 18:28:20
Author: danieljames
Date: 2007-12-19 18:28:19 EST (Wed, 19 Dec 2007)
New Revision: 42190
URL: http://svn.boost.org/trac/boost/changeset/42190
Log:
Merge in some minor changes.
Merged revisions 42157-42182 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev
........
r42157 | danieljames | 2007-12-18 23:26:06 +0000 (Tue, 18 Dec 2007) | 1 line
Tweak the function specifiers a tad bit.
........
r42158 | danieljames | 2007-12-18 23:30:52 +0000 (Tue, 18 Dec 2007) | 1 line
No need to create a node_constructor for every iteration.
........
r42159 | danieljames | 2007-12-18 23:50:29 +0000 (Tue, 18 Dec 2007) | 1 line
Pull another node_constructor out of a loop.
........
r42172 | danieljames | 2007-12-19 17:51:41 +0000 (Wed, 19 Dec 2007) | 1 line
Remove unrequired include.
........
r42181 | danieljames | 2007-12-19 22:37:34 +0000 (Wed, 19 Dec 2007) | 2 lines
Move the unordered library into 'branches' now that it has been accepted.
........
r42182 | danieljames | 2007-12-19 22:39:54 +0000 (Wed, 19 Dec 2007) | 4 lines
Actually, there are some things in the unordered code that aren't ready for
trunk, so I'll rename the branch and create another one to be added to trunk
later.
........
Properties modified:
branches/unordered/trunk/ (props changed)
Text files modified:
branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp | 27 +++++++++++++--------------
branches/unordered/trunk/libs/unordered/test/helpers/input_iterator.hpp | 1 -
2 files changed, 13 insertions(+), 15 deletions(-)
Modified: branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp 2007-12-19 18:28:19 EST (Wed, 19 Dec 2007)
@@ -238,40 +238,40 @@
// Methods for navigating groups of elements with equal keys.
#if BOOST_UNORDERED_HASH_EQUIVALENT
- static link_ptr& prev_in_group(link_ptr n) {
+ static inline link_ptr& prev_in_group(link_ptr n) {
return static_cast<node&>(*n).group_prev_;
}
// pre: Must be pointing to the first node in a group.
- static link_ptr last_in_group(link_ptr n) {
+ static inline link_ptr last_in_group(link_ptr n) {
BOOST_ASSERT(BOOST_HASH_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
return prev_in_group(n);
}
// pre: Must be pointing to the first node in a group.
- static link_ptr& next_group(link_ptr n) {
+ static inline link_ptr& next_group(link_ptr n) {
BOOST_ASSERT(BOOST_HASH_BORLAND_BOOL(n) && n != prev_in_group(n)->next_);
return prev_in_group(n)->next_;
}
#else
- static link_ptr last_in_group(link_ptr n) {
+ static inline link_ptr last_in_group(link_ptr n) {
return n;
}
- static link_ptr& next_group(link_ptr n) {
+ static inline link_ptr& next_group(link_ptr n) {
BOOST_ASSERT(n);
return n->next_;
}
#endif
// pre: Must be pointing to a node
- static node& get_node(link_ptr p) {
+ static inline node& get_node(link_ptr p) {
BOOST_ASSERT(p);
return static_cast<node&>(*p);
}
// pre: Must be pointing to a node
- static reference get_value(link_ptr p) {
+ static inline reference get_value(link_ptr p) {
BOOST_ASSERT(p);
return static_cast<node&>(*p).value_;
}
@@ -481,7 +481,7 @@
}
#if BOOST_UNORDERED_HASH_EQUIVALENT
- size_type group_count(link_ptr it) const
+ static size_type group_count(link_ptr it)
{
size_type count = 0;
link_ptr first = it;
@@ -492,7 +492,7 @@
return count;
}
#else
- size_type group_count(link_ptr) const
+ static size_type group_count(link_ptr)
{
return 1;
}
@@ -1568,9 +1568,9 @@
else {
// Only require basic exception safety here
reserve_extra(size() + distance);
+ node_constructor a(this->allocators_);
for (; i != j; ++i) {
- node_constructor a(this->allocators_);
a.construct(*i);
key_type const& k = extract_key(a.get()->value_);
@@ -1725,8 +1725,8 @@
template <typename InputIterator>
void insert(InputIterator i, InputIterator j)
{
- // If only inserting 1 element, get the required
- // safety since insert is only called once.
+ node_constructor a(this->allocators_);
+
for (; i != j; ++i) {
// No side effects in this initial code
size_type hash_value = hash_function()(extract_key(*i));
@@ -1740,7 +1740,6 @@
// Create the node before rehashing in case it throws an
// exception (need strong safety in such a case).
- node_constructor a(this->allocators_);
value_type const& v = *i;
a.construct(v);
@@ -1790,7 +1789,7 @@
size_type count(key_type const& k) const
{
link_ptr it = find_iterator(k); // throws, strong
- return BOOST_HASH_BORLAND_BOOL(it) ? this->group_count(it) : 0;
+ return BOOST_HASH_BORLAND_BOOL(it) ? data::group_count(it) : 0;
}
// find
Modified: branches/unordered/trunk/libs/unordered/test/helpers/input_iterator.hpp
==============================================================================
--- branches/unordered/trunk/libs/unordered/test/helpers/input_iterator.hpp (original)
+++ branches/unordered/trunk/libs/unordered/test/helpers/input_iterator.hpp 2007-12-19 18:28:19 EST (Wed, 19 Dec 2007)
@@ -7,7 +7,6 @@
#define BOOST_UNORDERED_TEST_HELPERS_INPUT_ITERATOR_HEADER
#include <boost/iterator_adaptors.hpp>
-#include <boost/shared_ptr.hpp>
namespace test
{
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