mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 03:17:15 +02:00
Unordered: merge from trunk.
[SVN r75908]
This commit is contained in:
@ -170,4 +170,9 @@ C++11 support has resulted in some breaking changes:
|
|||||||
the variadic consturctors define
|
the variadic consturctors define
|
||||||
`BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT`.
|
`BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT`.
|
||||||
|
|
||||||
|
[h2 Boost 1.49.0]
|
||||||
|
|
||||||
|
* Fix warning due to accidental odd assignment.
|
||||||
|
* Slightly better error messages.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
@ -173,6 +173,8 @@ BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
|
|||||||
//
|
//
|
||||||
// Used for piecewise construction.
|
// Used for piecewise construction.
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
|
#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
|
||||||
template<typename T> \
|
template<typename T> \
|
||||||
void construct_from_tuple(T* ptr, namespace_::tuple<>) \
|
void construct_from_tuple(T* ptr, namespace_::tuple<>) \
|
||||||
@ -206,6 +208,49 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std)
|
|||||||
#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
|
#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
|
||||||
#undef BOOST_UNORDERED_GET_TUPLE_ARG
|
#undef BOOST_UNORDERED_GET_TUPLE_ARG
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
template <int N> struct length {};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void construct_from_tuple_impl(
|
||||||
|
boost::unordered::detail::length<0>, T* ptr,
|
||||||
|
boost::tuple<>)
|
||||||
|
{
|
||||||
|
new ((void*) ptr) T();
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, _) \
|
||||||
|
template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||||
|
void construct_from_tuple_impl( \
|
||||||
|
boost::unordered::detail::length<n>, T* ptr, \
|
||||||
|
namespace_::tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
|
||||||
|
{ \
|
||||||
|
new ((void*) ptr) T( \
|
||||||
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
|
||||||
|
); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, _) \
|
||||||
|
boost::get<n>(x)
|
||||||
|
|
||||||
|
BOOST_PP_REPEAT_FROM_TO(1, 10, \
|
||||||
|
BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, _)
|
||||||
|
|
||||||
|
template <typename T, typename Tuple>
|
||||||
|
void construct_from_tuple(T* ptr, Tuple const& x)
|
||||||
|
{
|
||||||
|
construct_from_tuple_impl(
|
||||||
|
boost::unordered::detail::length<
|
||||||
|
boost::tuples::length<Tuple>::value>(),
|
||||||
|
ptr, x);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
|
||||||
|
#undef BOOST_UNORDERED_GET_TUPLE_ARG
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// SFINAE traits for construction.
|
// SFINAE traits for construction.
|
||||||
|
|
||||||
@ -334,7 +379,32 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std)
|
|||||||
args.a)); \
|
args.a)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
|
template <typename T, typename A0>
|
||||||
|
inline void construct_impl(T* address, emplace_args1<A0> const& args)
|
||||||
|
{
|
||||||
|
new((void*) address) T(boost::forward<A0>(args.a0));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename A0, typename A1>
|
||||||
|
inline void construct_impl(T* address, emplace_args2<A0, A1> const& args)
|
||||||
|
{
|
||||||
|
new((void*) address) T(
|
||||||
|
boost::forward<A0>(args.a0),
|
||||||
|
boost::forward<A1>(args.a1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename A0, typename A1, typename A2>
|
||||||
|
inline void construct_impl(T* address, emplace_args3<A0, A1, A2> const& args)
|
||||||
|
{
|
||||||
|
new((void*) address) T(
|
||||||
|
boost::forward<A0>(args.a0),
|
||||||
|
boost::forward<A1>(args.a1),
|
||||||
|
boost::forward<A2>(args.a2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||||
BOOST_UNORDERED_CONSTRUCT_IMPL, _)
|
BOOST_UNORDERED_CONSTRUCT_IMPL, _)
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_CONSTRUCT_IMPL
|
#undef BOOST_UNORDERED_CONSTRUCT_IMPL
|
||||||
|
@ -115,20 +115,21 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename H, typename P>
|
template <typename A, typename T, typename H, typename P>
|
||||||
struct multiset
|
struct multiset
|
||||||
{
|
{
|
||||||
typedef boost::unordered::detail::multiset<A, H, P> types;
|
typedef boost::unordered::detail::multiset<A, T, H, P> types;
|
||||||
|
|
||||||
typedef A allocator;
|
typedef T value_type;
|
||||||
typedef H hasher;
|
typedef H hasher;
|
||||||
typedef P key_equal;
|
typedef P key_equal;
|
||||||
|
typedef T key_type;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<A> traits;
|
typedef typename boost::unordered::detail::rebind_wrap<
|
||||||
typedef typename traits::value_type value_type;
|
A, value_type>::type allocator;
|
||||||
typedef value_type key_type;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
|
typedef boost::unordered::detail::allocator_traits<allocator> traits;
|
||||||
|
typedef boost::unordered::detail::pick_grouped_node<allocator, value_type> pick;
|
||||||
typedef typename pick::node node;
|
typedef typename pick::node node;
|
||||||
typedef typename pick::bucket bucket;
|
typedef typename pick::bucket bucket;
|
||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
@ -137,20 +138,21 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename K, typename H, typename P>
|
template <typename A, typename K, typename M, typename H, typename P>
|
||||||
struct multimap
|
struct multimap
|
||||||
{
|
{
|
||||||
typedef boost::unordered::detail::multimap<A, K, H, P> types;
|
typedef boost::unordered::detail::multimap<A, K, M, H, P> types;
|
||||||
|
|
||||||
typedef A allocator;
|
typedef std::pair<K const, M> value_type;
|
||||||
typedef H hasher;
|
typedef H hasher;
|
||||||
typedef P key_equal;
|
typedef P key_equal;
|
||||||
typedef K key_type;
|
typedef K key_type;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<A> traits;
|
typedef typename boost::unordered::detail::rebind_wrap<
|
||||||
typedef typename traits::value_type value_type;
|
A, value_type>::type allocator;
|
||||||
|
|
||||||
typedef boost::unordered::detail::pick_grouped_node<A, value_type> pick;
|
typedef boost::unordered::detail::allocator_traits<allocator> traits;
|
||||||
|
typedef boost::unordered::detail::pick_grouped_node<allocator, value_type> pick;
|
||||||
typedef typename pick::node node;
|
typedef typename pick::node node;
|
||||||
typedef typename pick::bucket bucket;
|
typedef typename pick::bucket bucket;
|
||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
@ -451,22 +453,22 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BOOST_NO_RVALUE_REFERENCES)
|
#if defined(BOOST_NO_RVALUE_REFERENCES)
|
||||||
node_pointer emplace(boost::unordered::detail::emplace_args1<
|
iterator emplace(boost::unordered::detail::emplace_args1<
|
||||||
boost::unordered::detail::please_ignore_this_overload> const&)
|
boost::unordered::detail::please_ignore_this_overload> const&)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(false);
|
BOOST_ASSERT(false);
|
||||||
return this->begin();
|
return iterator();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
|
template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
|
||||||
node_pointer emplace(BOOST_UNORDERED_EMPLACE_ARGS)
|
iterator emplace(BOOST_UNORDERED_EMPLACE_ARGS)
|
||||||
{
|
{
|
||||||
node_constructor a(this->node_alloc());
|
node_constructor a(this->node_alloc());
|
||||||
a.construct_node();
|
a.construct_node();
|
||||||
a.construct_value(BOOST_UNORDERED_EMPLACE_FORWARD);
|
a.construct_value(BOOST_UNORDERED_EMPLACE_FORWARD);
|
||||||
|
|
||||||
return emplace_impl(a);
|
return iterator(emplace_impl(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -174,13 +174,13 @@ namespace boost { namespace unordered { namespace iterator_detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
iterator& operator++() {
|
iterator& operator++() {
|
||||||
node_ = node_ = static_cast<node_pointer>(node_->next_);
|
node_ = static_cast<node_pointer>(node_->next_);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator operator++(int) {
|
iterator operator++(int) {
|
||||||
iterator tmp(node_);
|
iterator tmp(node_);
|
||||||
node_ = node_ = static_cast<node_pointer>(node_->next_);
|
node_ = static_cast<node_pointer>(node_->next_);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ namespace boost { namespace unordered { namespace iterator_detail {
|
|||||||
|
|
||||||
c_iterator operator++(int) {
|
c_iterator operator++(int) {
|
||||||
c_iterator tmp(node_);
|
c_iterator tmp(node_);
|
||||||
node_ = node_ = static_cast<node_pointer>(node_->next_);
|
node_ = static_cast<node_pointer>(node_->next_);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,20 +111,21 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename H, typename P>
|
template <typename A, typename T, typename H, typename P>
|
||||||
struct set
|
struct set
|
||||||
{
|
{
|
||||||
typedef boost::unordered::detail::set<A, H, P> types;
|
typedef boost::unordered::detail::set<A, T, H, P> types;
|
||||||
|
|
||||||
typedef A allocator;
|
typedef T value_type;
|
||||||
typedef H hasher;
|
typedef H hasher;
|
||||||
typedef P key_equal;
|
typedef P key_equal;
|
||||||
|
typedef T key_type;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<A> traits;
|
typedef typename boost::unordered::detail::rebind_wrap<
|
||||||
typedef typename traits::value_type value_type;
|
A, value_type>::type allocator;
|
||||||
typedef value_type key_type;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::pick_node<A, value_type> pick;
|
typedef boost::unordered::detail::allocator_traits<allocator> traits;
|
||||||
|
typedef boost::unordered::detail::pick_node<allocator, value_type> pick;
|
||||||
typedef typename pick::node node;
|
typedef typename pick::node node;
|
||||||
typedef typename pick::bucket bucket;
|
typedef typename pick::bucket bucket;
|
||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
@ -133,20 +134,21 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
typedef boost::unordered::detail::set_extractor<value_type> extractor;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename A, typename K, typename H, typename P>
|
template <typename A, typename K, typename M, typename H, typename P>
|
||||||
struct map
|
struct map
|
||||||
{
|
{
|
||||||
typedef boost::unordered::detail::map<A, K, H, P> types;
|
typedef boost::unordered::detail::map<A, K, M, H, P> types;
|
||||||
|
|
||||||
typedef A allocator;
|
typedef std::pair<K const, M> value_type;
|
||||||
typedef H hasher;
|
typedef H hasher;
|
||||||
typedef P key_equal;
|
typedef P key_equal;
|
||||||
typedef K key_type;
|
typedef K key_type;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<A> traits;
|
typedef typename boost::unordered::detail::rebind_wrap<
|
||||||
typedef typename traits::value_type value_type;
|
A, value_type>::type allocator;
|
||||||
|
|
||||||
typedef boost::unordered::detail::pick_node<A, value_type> pick;
|
typedef boost::unordered::detail::allocator_traits<allocator> traits;
|
||||||
|
typedef boost::unordered::detail::pick_node<allocator, value_type> pick;
|
||||||
typedef typename pick::node node;
|
typedef typename pick::node node;
|
||||||
typedef typename pick::bucket bucket;
|
typedef typename pick::bucket bucket;
|
||||||
typedef typename pick::link_pointer link_pointer;
|
typedef typename pick::link_pointer link_pointer;
|
||||||
|
@ -54,15 +54,9 @@ namespace unordered
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef typename boost::unordered::detail::rebind_wrap<
|
typedef boost::unordered::detail::map<A, K, T, H, P> types;
|
||||||
allocator_type, value_type>::type
|
typedef typename types::allocator value_allocator;
|
||||||
value_allocator;
|
typedef typename types::traits allocator_traits;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
|
||||||
allocator_traits;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::map<value_allocator, K, H, P>
|
|
||||||
types;
|
|
||||||
typedef typename types::table table;
|
typedef typename types::table table;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -84,7 +78,7 @@ namespace unordered
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
table table_;
|
table table_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// constructors
|
// constructors
|
||||||
@ -224,10 +218,105 @@ namespace unordered
|
|||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace_hint(const_iterator, Args&&... args)
|
iterator emplace_hint(const_iterator, Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...).first);
|
return table_.emplace(std::forward<Args>(args)...).first;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
// 0 argument emplace requires special treatment in case
|
||||||
|
// the container is instantiated with a value type that
|
||||||
|
// doesn't have a default constructor.
|
||||||
|
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type())
|
||||||
|
{
|
||||||
|
return this->emplace(boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator emplace_hint(const_iterator hint,
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return this->emplace_hint(hint, boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
std::pair<iterator, bool> emplace(BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template < \
|
template < \
|
||||||
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
||||||
@ -251,39 +340,18 @@ namespace unordered
|
|||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
return iterator(table_.emplace( \
|
return table_.emplace( \
|
||||||
boost::unordered::detail::create_emplace_args( \
|
boost::unordered::detail::create_emplace_args( \
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
a) \
|
a) \
|
||||||
)).first); \
|
)).first; \
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
|
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||||
BOOST_UNORDERED_EMPLACE, _)
|
BOOST_UNORDERED_EMPLACE, _)
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_EMPLACE
|
#undef BOOST_UNORDERED_EMPLACE
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
|
||||||
|
|
||||||
std::pair<iterator, bool> emplace(
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type())
|
|
||||||
{
|
|
||||||
return this->emplace(boost::move(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
iterator emplace_hint(const_iterator hint,
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return this->emplace_hint(hint, boost::move(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::pair<iterator, bool> insert(value_type const& x)
|
std::pair<iterator, bool> insert(value_type const& x)
|
||||||
@ -446,15 +514,9 @@ namespace unordered
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef typename boost::unordered::detail::rebind_wrap<
|
typedef boost::unordered::detail::multimap<A, K, T, H, P> types;
|
||||||
allocator_type, value_type>::type
|
typedef typename types::allocator value_allocator;
|
||||||
value_allocator;
|
typedef typename types::traits allocator_traits;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
|
||||||
allocator_traits;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::multimap<value_allocator, K, H, P>
|
|
||||||
types;
|
|
||||||
typedef typename types::table table;
|
typedef typename types::table table;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -611,16 +673,111 @@ namespace unordered
|
|||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace(Args&&... args)
|
iterator emplace(Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...));
|
return table_.emplace(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace_hint(const_iterator, Args&&... args)
|
iterator emplace_hint(const_iterator, Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...));
|
return table_.emplace(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
// 0 argument emplace requires special treatment in case
|
||||||
|
// the container is instantiated with a value type that
|
||||||
|
// doesn't have a default constructor.
|
||||||
|
|
||||||
|
iterator emplace(
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type())
|
||||||
|
{
|
||||||
|
return this->emplace(boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator emplace_hint(const_iterator hint,
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return this->emplace_hint(hint, boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace(BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template < \
|
template < \
|
||||||
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
||||||
@ -629,11 +786,11 @@ namespace unordered
|
|||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
return iterator(table_.emplace( \
|
return table_.emplace( \
|
||||||
boost::unordered::detail::create_emplace_args( \
|
boost::unordered::detail::create_emplace_args( \
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
a) \
|
a) \
|
||||||
))); \
|
)); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
template < \
|
template < \
|
||||||
@ -644,39 +801,18 @@ namespace unordered
|
|||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
return iterator(table_.emplace( \
|
return table_.emplace( \
|
||||||
boost::unordered::detail::create_emplace_args( \
|
boost::unordered::detail::create_emplace_args( \
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
a) \
|
a) \
|
||||||
))); \
|
)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
|
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||||
BOOST_UNORDERED_EMPLACE, _)
|
BOOST_UNORDERED_EMPLACE, _)
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_EMPLACE
|
#undef BOOST_UNORDERED_EMPLACE
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
|
||||||
|
|
||||||
iterator emplace(
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type())
|
|
||||||
{
|
|
||||||
return iterator(this->emplace(boost::move(v)));
|
|
||||||
}
|
|
||||||
|
|
||||||
iterator emplace_hint(const_iterator hint,
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return iterator(this->emplace_hint(hint, boost::move(v)));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
iterator insert(value_type const& x)
|
iterator insert(value_type const& x)
|
||||||
|
@ -52,15 +52,9 @@ namespace unordered
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef typename boost::unordered::detail::rebind_wrap<
|
typedef boost::unordered::detail::set<A, T, H, P> types;
|
||||||
allocator_type, value_type>::type
|
typedef typename types::allocator value_allocator;
|
||||||
value_allocator;
|
typedef typename types::traits allocator_traits;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
|
||||||
allocator_traits;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::set<value_allocator, H, P>
|
|
||||||
types;
|
|
||||||
typedef typename types::table table;
|
typedef typename types::table table;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -222,10 +216,105 @@ namespace unordered
|
|||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace_hint(const_iterator, Args&&... args)
|
iterator emplace_hint(const_iterator, Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...).first);
|
return table_.emplace(std::forward<Args>(args)...).first;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
// 0 argument emplace requires special treatment in case
|
||||||
|
// the container is instantiated with a value type that
|
||||||
|
// doesn't have a default constructor.
|
||||||
|
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type())
|
||||||
|
{
|
||||||
|
return this->emplace(boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator emplace_hint(const_iterator hint,
|
||||||
|
boost::unordered::detail::empty_emplace
|
||||||
|
= boost::unordered::detail::empty_emplace(),
|
||||||
|
value_type v = value_type()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return this->emplace_hint(hint, boost::move(v));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
std::pair<iterator, bool> emplace(BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
std::pair<iterator, bool> emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
).first;
|
||||||
|
}
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template < \
|
template < \
|
||||||
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
||||||
@ -249,39 +338,18 @@ namespace unordered
|
|||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
return iterator(table_.emplace( \
|
return table_.emplace( \
|
||||||
boost::unordered::detail::create_emplace_args( \
|
boost::unordered::detail::create_emplace_args( \
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
a) \
|
a) \
|
||||||
)).first); \
|
)).first; \
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
|
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||||
BOOST_UNORDERED_EMPLACE, _)
|
BOOST_UNORDERED_EMPLACE, _)
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_EMPLACE
|
#undef BOOST_UNORDERED_EMPLACE
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
|
||||||
|
|
||||||
std::pair<iterator, bool> emplace(
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type())
|
|
||||||
{
|
|
||||||
return this->emplace(boost::move(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
iterator emplace_hint(const_iterator hint,
|
|
||||||
boost::unordered::detail::empty_emplace
|
|
||||||
= boost::unordered::detail::empty_emplace(),
|
|
||||||
value_type v = value_type()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return iterator(this->emplace_hint(hint, boost::move(v)));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::pair<iterator, bool> insert(value_type const& x)
|
std::pair<iterator, bool> insert(value_type const& x)
|
||||||
@ -429,15 +497,9 @@ namespace unordered
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef typename boost::unordered::detail::rebind_wrap<
|
typedef boost::unordered::detail::multiset<A, T, H, P> types;
|
||||||
allocator_type, value_type>::type
|
typedef typename types::allocator value_allocator;
|
||||||
value_allocator;
|
typedef typename types::traits allocator_traits;
|
||||||
|
|
||||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
|
||||||
allocator_traits;
|
|
||||||
|
|
||||||
typedef boost::unordered::detail::multiset<value_allocator, H, P>
|
|
||||||
types;
|
|
||||||
typedef typename types::table table;
|
typedef typename types::table table;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -594,53 +656,22 @@ namespace unordered
|
|||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace(Args&&... args)
|
iterator emplace(Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...));
|
return table_.emplace(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
iterator emplace_hint(const_iterator, Args&&... args)
|
iterator emplace_hint(const_iterator, Args&&... args)
|
||||||
{
|
{
|
||||||
return iterator(table_.emplace(std::forward<Args>(args)...));
|
return table_.emplace(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
|
||||||
template < \
|
|
||||||
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
|
||||||
> \
|
|
||||||
iterator emplace( \
|
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
|
||||||
) \
|
|
||||||
{ \
|
|
||||||
return iterator(table_.emplace( \
|
|
||||||
boost::unordered::detail::create_emplace_args( \
|
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
|
||||||
a) \
|
|
||||||
))); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
template < \
|
|
||||||
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
|
||||||
> \
|
|
||||||
iterator emplace_hint( \
|
|
||||||
const_iterator, \
|
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
|
||||||
) \
|
|
||||||
{ \
|
|
||||||
return iterator(table_.emplace( \
|
|
||||||
boost::unordered::detail::create_emplace_args( \
|
|
||||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
|
||||||
a) \
|
|
||||||
))); \
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
|
|
||||||
BOOST_UNORDERED_EMPLACE, _)
|
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_EMPLACE
|
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
// 0 argument emplace requires special treatment in case
|
||||||
|
// the container is instantiated with a value type that
|
||||||
|
// doesn't have a default constructor.
|
||||||
|
|
||||||
iterator emplace(
|
iterator emplace(
|
||||||
boost::unordered::detail::empty_emplace
|
boost::unordered::detail::empty_emplace
|
||||||
= boost::unordered::detail::empty_emplace(),
|
= boost::unordered::detail::empty_emplace(),
|
||||||
@ -660,6 +691,111 @@ namespace unordered
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace(BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0>
|
||||||
|
iterator emplace_hint(const_iterator, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace(
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1, typename A2>
|
||||||
|
iterator emplace_hint(const_iterator,
|
||||||
|
BOOST_FWD_REF(A0) a0,
|
||||||
|
BOOST_FWD_REF(A1) a1,
|
||||||
|
BOOST_FWD_REF(A2) a2)
|
||||||
|
{
|
||||||
|
return table_.emplace(
|
||||||
|
boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0),
|
||||||
|
boost::forward<A1>(a1),
|
||||||
|
boost::forward<A2>(a2))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
|
template < \
|
||||||
|
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
||||||
|
> \
|
||||||
|
iterator emplace( \
|
||||||
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
return table_.emplace( \
|
||||||
|
boost::unordered::detail::create_emplace_args( \
|
||||||
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
|
a) \
|
||||||
|
)); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
template < \
|
||||||
|
BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
|
||||||
|
> \
|
||||||
|
iterator emplace_hint( \
|
||||||
|
const_iterator, \
|
||||||
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a) \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
return table_.emplace( \
|
||||||
|
boost::unordered::detail::create_emplace_args( \
|
||||||
|
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, \
|
||||||
|
a) \
|
||||||
|
)); \
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||||
|
BOOST_UNORDERED_EMPLACE, _)
|
||||||
|
|
||||||
|
#undef BOOST_UNORDERED_EMPLACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
iterator insert(value_type const& x)
|
iterator insert(value_type const& x)
|
||||||
|
@ -9,13 +9,13 @@ project unordered-test/unordered
|
|||||||
: requirements
|
: requirements
|
||||||
<warnings>all
|
<warnings>all
|
||||||
<toolset>intel:<warnings>on
|
<toolset>intel:<warnings>on
|
||||||
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
<toolset>gcc:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wno-long-long"
|
||||||
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
<toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion"
|
||||||
#<toolset>gcc:<define>_GLIBCXX_DEBUG
|
#<toolset>gcc:<define>_GLIBCXX_DEBUG
|
||||||
#<toolset>darwin:<define>_GLIBCXX_DEBUG
|
#<toolset>darwin:<define>_GLIBCXX_DEBUG
|
||||||
#<toolset>msvc:<warnings-as-errors>on
|
#<toolset>msvc:<warnings-as-errors>on
|
||||||
#<toolset>gcc:<warnings-as-errors>on
|
<toolset>gcc:<warnings-as-errors>on
|
||||||
#<toolset>darwin:<warnings-as-errors>on
|
<toolset>darwin:<warnings-as-errors>on
|
||||||
;
|
;
|
||||||
|
|
||||||
test-suite unordered
|
test-suite unordered
|
||||||
|
Reference in New Issue
Block a user