mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 20:04:29 +02:00
Split up emplace and emplace_hint code
Busywork I guess, but I think it's more readable this way. The emplace macros are still unreadable, but I think they're rarely used. Btw. a bit weird that clang format has removed the indentation on the '// emplace' comment, not sure why that is.
This commit is contained in:
@@ -234,18 +234,13 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
// emplace
|
// emplace
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
|
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
|
||||||
{
|
{
|
||||||
return table_.emplace(boost::forward<Args>(args)...);
|
return table_.emplace(boost::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
@@ -262,14 +257,6 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
return this->emplace(boost::move(v));
|
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
|
||||||
|
|
||||||
template <typename A0>
|
template <typename A0>
|
||||||
@@ -279,14 +266,6 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
boost::forward<A0>(a0)));
|
boost::forward<A0>(a0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
template <typename A0, typename A1>
|
||||||
std::pair<iterator, bool> emplace(
|
std::pair<iterator, bool> emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
@@ -295,15 +274,6 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
|
||||||
iterator emplace_hint(
|
|
||||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
std::pair<iterator, bool> emplace(
|
std::pair<iterator, bool> emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -313,6 +283,47 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template <class... Args>
|
||||||
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
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_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(
|
||||||
|
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -323,6 +334,10 @@ template <class K, class T, class H, class P, class A> class unordered_map
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||||
std::pair<iterator, bool> emplace( \
|
std::pair<iterator, bool> emplace( \
|
||||||
@@ -971,16 +986,12 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
// emplace
|
// emplace
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
template <class... Args> iterator emplace(BOOST_FWD_REF(Args)... args)
|
template <class... Args> iterator emplace(BOOST_FWD_REF(Args)... args)
|
||||||
{
|
{
|
||||||
return table_.emplace(boost::forward<Args>(args)...);
|
return table_.emplace(boost::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
@@ -996,14 +1007,6 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
return this->emplace(boost::move(v));
|
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
|
||||||
|
|
||||||
template <typename A0> iterator emplace(BOOST_FWD_REF(A0) a0)
|
template <typename A0> iterator emplace(BOOST_FWD_REF(A0) a0)
|
||||||
@@ -1012,14 +1015,6 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
boost::forward<A0>(a0)));
|
boost::forward<A0>(a0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
template <typename A0, typename A1>
|
||||||
iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
{
|
{
|
||||||
@@ -1027,15 +1022,6 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
|
||||||
iterator emplace_hint(
|
|
||||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace(
|
iterator emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -1045,6 +1031,46 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template <class... Args>
|
||||||
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
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_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0)));
|
||||||
|
}
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(
|
||||||
|
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -1055,6 +1081,10 @@ template <class K, class T, class H, class P, class A> class unordered_multimap
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||||
iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||||
|
@@ -232,17 +232,13 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
// emplace
|
// emplace
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
|
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
|
||||||
{
|
{
|
||||||
return table_.emplace(boost::forward<Args>(args)...);
|
return table_.emplace(boost::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
@@ -259,14 +255,6 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
return this->emplace(boost::move(v));
|
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
|
||||||
|
|
||||||
template <typename A0>
|
template <typename A0>
|
||||||
@@ -276,14 +264,6 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
boost::forward<A0>(a0)));
|
boost::forward<A0>(a0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
template <typename A0, typename A1>
|
||||||
std::pair<iterator, bool> emplace(
|
std::pair<iterator, bool> emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
@@ -292,15 +272,6 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
|
||||||
iterator emplace_hint(
|
|
||||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
std::pair<iterator, bool> emplace(
|
std::pair<iterator, bool> emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -310,6 +281,47 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template <class... Args>
|
||||||
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
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_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(
|
||||||
|
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -320,6 +332,10 @@ template <class T, class H, class P, class A> class unordered_set
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||||
std::pair<iterator, bool> emplace( \
|
std::pair<iterator, bool> emplace( \
|
||||||
@@ -703,11 +719,6 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
return table_.emplace(boost::forward<Args>(args)...);
|
return table_.emplace(boost::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class... Args>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
@@ -723,14 +734,6 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
return this->emplace(boost::move(v));
|
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
|
||||||
|
|
||||||
template <typename A0> iterator emplace(BOOST_FWD_REF(A0) a0)
|
template <typename A0> iterator emplace(BOOST_FWD_REF(A0) a0)
|
||||||
@@ -739,14 +742,6 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
boost::forward<A0>(a0)));
|
boost::forward<A0>(a0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0>
|
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
template <typename A0, typename A1>
|
||||||
iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
iterator emplace(BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
{
|
{
|
||||||
@@ -754,15 +749,6 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1>
|
|
||||||
iterator emplace_hint(
|
|
||||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
|
||||||
{
|
|
||||||
return table_.emplace_hint(
|
|
||||||
hint, boost::unordered::detail::create_emplace_args(
|
|
||||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace(
|
iterator emplace(
|
||||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -772,6 +758,47 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template <class... Args>
|
||||||
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(Args)... args)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(hint, boost::forward<Args>(args)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
|
||||||
|
|
||||||
|
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_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename A0, typename A1>
|
||||||
|
iterator emplace_hint(
|
||||||
|
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||||
|
{
|
||||||
|
return table_.emplace_hint(
|
||||||
|
hint, boost::unordered::detail::create_emplace_args(
|
||||||
|
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename A0, typename A1, typename A2>
|
template <typename A0, typename A1, typename A2>
|
||||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||||
@@ -782,6 +809,10 @@ template <class T, class H, class P, class A> class unordered_multiset
|
|||||||
boost::forward<A2>(a2)));
|
boost::forward<A2>(a2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
#define BOOST_UNORDERED_EMPLACE(z, n, _) \
|
||||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||||
iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
iterator emplace(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||||
|
Reference in New Issue
Block a user