Unordered: Better emplace_args implementation.

And some misc. cleanup.

[SVN r74750]
This commit is contained in:
Daniel James
2011-10-06 08:03:25 +00:00
parent ad38ecf6d8
commit 3a909c8747
12 changed files with 522 additions and 622 deletions

View File

@@ -52,14 +52,14 @@ namespace unordered
private:
typedef typename ::boost::unordered::detail::rebind_wrap<
typedef typename boost::unordered::detail::rebind_wrap<
allocator_type, value_type>::type
value_allocator;
typedef ::boost::unordered::detail::allocator_traits<value_allocator>
typedef boost::unordered::detail::allocator_traits<value_allocator>
allocator_traits;
typedef ::boost::unordered::detail::set<value_allocator, H, P>
typedef boost::unordered::detail::set<value_allocator, H, P>
types;
typedef typename types::table table;
@@ -88,7 +88,7 @@ namespace unordered
// constructors
explicit unordered_set(
size_type = ::boost::unordered::detail::default_bucket_count,
size_type = boost::unordered::detail::default_bucket_count,
const hasher& = hasher(),
const key_equal& = key_equal(),
const allocator_type& = allocator_type());
@@ -120,7 +120,7 @@ namespace unordered
unordered_set(unordered_set const&, allocator_type const&);
unordered_set(BOOST_RV_REF(unordered_set) other)
: table_(other.table_, ::boost::unordered::detail::move_tag())
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
@@ -131,7 +131,7 @@ namespace unordered
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_set(
std::initializer_list<value_type>,
size_type = ::boost::unordered::detail::default_bucket_count,
size_type = boost::unordered::detail::default_bucket_count,
const hasher& = hasher(),
const key_equal&l = key_equal(),
const allocator_type& = allocator_type());
@@ -235,7 +235,7 @@ namespace unordered
) \
{ \
return table_.emplace( \
::boost::unordered::detail::create_emplace_args( \
boost::unordered::detail::create_emplace_args( \
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
a) \
)); \
@@ -250,7 +250,7 @@ namespace unordered
) \
{ \
return iterator(table_.emplace( \
::boost::unordered::detail::create_emplace_args( \
boost::unordered::detail::create_emplace_args( \
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
a) \
)).first); \
@@ -427,14 +427,14 @@ namespace unordered
private:
typedef typename ::boost::unordered::detail::rebind_wrap<
typedef typename boost::unordered::detail::rebind_wrap<
allocator_type, value_type>::type
value_allocator;
typedef ::boost::unordered::detail::allocator_traits<value_allocator>
typedef boost::unordered::detail::allocator_traits<value_allocator>
allocator_traits;
typedef ::boost::unordered::detail::multiset<value_allocator, H, P>
typedef boost::unordered::detail::multiset<value_allocator, H, P>
types;
typedef typename types::table table;
@@ -463,7 +463,7 @@ namespace unordered
// constructors
explicit unordered_multiset(
size_type = ::boost::unordered::detail::default_bucket_count,
size_type = boost::unordered::detail::default_bucket_count,
const hasher& = hasher(),
const key_equal& = key_equal(),
const allocator_type& = allocator_type());
@@ -495,7 +495,7 @@ namespace unordered
unordered_multiset(unordered_multiset const&, allocator_type const&);
unordered_multiset(BOOST_RV_REF(unordered_multiset) other)
: table_(other.table_, ::boost::unordered::detail::move_tag())
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
@@ -506,7 +506,7 @@ namespace unordered
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
unordered_multiset(
std::initializer_list<value_type>,
size_type = ::boost::unordered::detail::default_bucket_count,
size_type = boost::unordered::detail::default_bucket_count,
const hasher& = hasher(),
const key_equal&l = key_equal(),
const allocator_type& = allocator_type());
@@ -610,7 +610,7 @@ namespace unordered
) \
{ \
return iterator(table_.emplace( \
::boost::unordered::detail::create_emplace_args( \
boost::unordered::detail::create_emplace_args( \
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
a) \
))); \
@@ -625,7 +625,7 @@ namespace unordered
) \
{ \
return iterator(table_.emplace( \
::boost::unordered::detail::create_emplace_args( \
boost::unordered::detail::create_emplace_args( \
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
a) \
))); \
@@ -800,7 +800,7 @@ namespace unordered
template <class T, class H, class P, class A>
unordered_set<T,H,P,A>::unordered_set(allocator_type const& a)
: table_(::boost::unordered::detail::default_bucket_count,
: table_(boost::unordered::detail::default_bucket_count,
hasher(), key_equal(), a)
{
}
@@ -815,7 +815,7 @@ namespace unordered
template <class T, class H, class P, class A>
template <class InputIt>
unordered_set<T,H,P,A>::unordered_set(InputIt f, InputIt l)
: table_(::boost::unordered::detail::initial_size(f, l),
: table_(boost::unordered::detail::initial_size(f, l),
hasher(), key_equal(), allocator_type())
{
table_.insert_range(f, l);
@@ -828,7 +828,7 @@ namespace unordered
size_type n,
const hasher &hf,
const key_equal &eql)
: table_(::boost::unordered::detail::initial_size(f, l, n),
: table_(boost::unordered::detail::initial_size(f, l, n),
hf, eql, allocator_type())
{
table_.insert_range(f, l);
@@ -842,7 +842,7 @@ namespace unordered
const hasher &hf,
const key_equal &eql,
const allocator_type &a)
: table_(::boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
: table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
{
table_.insert_range(f, l);
}
@@ -862,7 +862,7 @@ namespace unordered
template <class T, class H, class P, class A>
unordered_set<T,H,P,A>::unordered_set(
unordered_set&& other, allocator_type const& a)
: table_(other.table_, a, ::boost::unordered::detail::move_tag())
: table_(other.table_, a, boost::unordered::detail::move_tag())
{
}
@@ -875,7 +875,7 @@ namespace unordered
std::initializer_list<value_type> list, size_type n,
const hasher &hf, const key_equal &eql, const allocator_type &a)
: table_(
::boost::unordered::detail::initial_size(
boost::unordered::detail::initial_size(
list.begin(), list.end(), n),
hf, eql, a)
{
@@ -1078,7 +1078,7 @@ namespace unordered
template <class T, class H, class P, class A>
unordered_multiset<T,H,P,A>::unordered_multiset(allocator_type const& a)
: table_(::boost::unordered::detail::default_bucket_count,
: table_(boost::unordered::detail::default_bucket_count,
hasher(), key_equal(), a)
{
}
@@ -1093,7 +1093,7 @@ namespace unordered
template <class T, class H, class P, class A>
template <class InputIt>
unordered_multiset<T,H,P,A>::unordered_multiset(InputIt f, InputIt l)
: table_(::boost::unordered::detail::initial_size(f, l),
: table_(boost::unordered::detail::initial_size(f, l),
hasher(), key_equal(), allocator_type())
{
table_.insert_range(f, l);
@@ -1106,7 +1106,7 @@ namespace unordered
size_type n,
const hasher &hf,
const key_equal &eql)
: table_(::boost::unordered::detail::initial_size(f, l, n),
: table_(boost::unordered::detail::initial_size(f, l, n),
hf, eql, allocator_type())
{
table_.insert_range(f, l);
@@ -1120,7 +1120,7 @@ namespace unordered
const hasher &hf,
const key_equal &eql,
const allocator_type &a)
: table_(::boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
: table_(boost::unordered::detail::initial_size(f, l, n), hf, eql, a)
{
table_.insert_range(f, l);
}
@@ -1140,7 +1140,7 @@ namespace unordered
template <class T, class H, class P, class A>
unordered_multiset<T,H,P,A>::unordered_multiset(
unordered_multiset&& other, allocator_type const& a)
: table_(other.table_, a, ::boost::unordered::detail::move_tag())
: table_(other.table_, a, boost::unordered::detail::move_tag())
{
}
@@ -1153,7 +1153,7 @@ namespace unordered
std::initializer_list<value_type> list, size_type n,
const hasher &hf, const key_equal &eql, const allocator_type &a)
: table_(
::boost::unordered::detail::initial_size(
boost::unordered::detail::initial_size(
list.begin(), list.end(), n),
hf, eql, a)
{