Another inline.

[SVN r61872]
This commit is contained in:
Daniel James
2010-05-09 07:24:47 +00:00
parent 076e195cac
commit dfaa61b666
4 changed files with 22 additions and 27 deletions

View File

@ -58,6 +58,12 @@
#endif #endif
#if BOOST_WORKAROUND(__BORLANDC__, <= 0X0582)
#define BOOST_UNORDERED_BORLAND_BOOL(x) (bool)(x)
#else
#define BOOST_UNORDERED_BORLAND_BOOL(x) x
#endif
namespace boost { namespace unordered_detail { namespace boost { namespace unordered_detail {
static const float minimum_max_load_factor = 1e-3f; static const float minimum_max_load_factor = 1e-3f;
@ -469,13 +475,25 @@ namespace boost { namespace unordered_detail {
return extractor::extract(node::get_value(n)); return extractor::extract(node::get_value(n));
} }
bool equal(key_type const& k, value_type const& v) const; bool equal(key_type const& k, value_type const& v) const;
template <class Key, class Pred> template <class Key, class Pred>
node_ptr find_iterator(bucket_ptr bucket, Key const& k, inline node_ptr find_iterator(bucket_ptr bucket, Key const& k,
Pred const&) const; Pred const& eq) const
{
node_ptr it = bucket->next_;
while (BOOST_UNORDERED_BORLAND_BOOL(it) &&
!eq(k, get_key(node::get_value(it))))
{
it = node::next_group(it);
}
return it;
}
node_ptr find_iterator(bucket_ptr bucket, key_type const& k) const; node_ptr find_iterator(bucket_ptr bucket, key_type const& k) const;
node_ptr find_iterator(key_type const& k) const; node_ptr find_iterator(key_type const& k) const;
node_ptr* find_for_erase(bucket_ptr bucket, key_type const& k) const; node_ptr* find_for_erase(bucket_ptr bucket, key_type const& k) const;
// Load methods // Load methods
std::size_t max_size() const; std::size_t max_size() const;

View File

@ -16,12 +16,6 @@
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/unordered/detail/fwd.hpp> #include <boost/unordered/detail/fwd.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, <= 0X0582)
#define BOOST_UNORDERED_BORLAND_BOOL(x) (bool)(x)
#else
#define BOOST_UNORDERED_BORLAND_BOOL(x) x
#endif
namespace boost { namespace unordered_detail { namespace boost { namespace unordered_detail {
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

View File

@ -29,23 +29,6 @@ namespace boost { namespace unordered_detail {
return this->key_eq()(k, get_key(v)); return this->key_eq()(k, get_key(v));
} }
// strong exception safety, no side effects
template <class T>
template <class Key, class Pred>
inline BOOST_DEDUCED_TYPENAME T::node_ptr
hash_table<T>::find_iterator(bucket_ptr bucket, Key const& k,
Pred const& eq) const
{
node_ptr it = bucket->next_;
while (BOOST_UNORDERED_BORLAND_BOOL(it) &&
!eq(k, get_key(node::get_value(it))))
{
it = node::next_group(it);
}
return it;
}
// strong exception safety, no side effects // strong exception safety, no side effects
template <class T> template <class T>
inline BOOST_DEDUCED_TYPENAME T::node_ptr inline BOOST_DEDUCED_TYPENAME T::node_ptr

View File

@ -248,7 +248,7 @@ namespace boost { namespace unordered_detail {
// strong otherwise // strong otherwise
template<class... Args> template<class... Args>
emplace_return hash_unique_table<T>::emplace(Args&&... args) emplace_return emplace(Args&&... args)
{ {
return this->size_ ? return this->size_ ?
emplace_impl( emplace_impl(