mirror of
https://github.com/boostorg/unordered.git
synced 2025-10-17 18:05:25 +02:00
Unordered: Remove deprecated variadic pair constructors.
This was emulating them as specified in older standard drafts. [SVN r81384]
This commit is contained in:
@@ -930,28 +930,11 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
|
||||
// The decision is made on the first argument.
|
||||
|
||||
|
||||
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
|
||||
template <typename A, typename B, typename A0>
|
||||
struct emulation1 {
|
||||
static choice1::type test(choice1, std::pair<A, B> const&);
|
||||
static choice2::type test(choice2, A const&);
|
||||
static choice3::type test(choice3, convert_from_anything const&);
|
||||
|
||||
enum { value =
|
||||
sizeof(test(choose(), boost::unordered::detail::make<A0>())) ==
|
||||
sizeof(choice2::type) };
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename A, typename B, typename A0>
|
||||
struct check3_base {
|
||||
static choice1::type test(choice1,
|
||||
boost::unordered::piecewise_construct_t);
|
||||
|
||||
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
|
||||
static choice2::type test(choice2, A const&);
|
||||
#endif
|
||||
|
||||
static choice3::type test(choice3, ...);
|
||||
|
||||
enum { value =
|
||||
@@ -963,14 +946,6 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
|
||||
enum { value = check3_base<A,B,A0>::value == sizeof(choice1::type) };
|
||||
};
|
||||
|
||||
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
|
||||
template <typename A, typename B, typename A0>
|
||||
struct emulation3 {
|
||||
enum { value = check3_base<A,B,A0>::value == sizeof(choice2::type) };
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// TODO: Full construct?
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
|
||||
@@ -997,51 +972,6 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
|
||||
boost::addressof(address->second), boost::forward<A2>(a2));
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
|
||||
|
||||
template <typename Alloc, typename A, typename B, typename A0>
|
||||
inline typename enable_if<emulation1<A, B, A0>, void>::type
|
||||
construct_value_impl(Alloc& alloc, std::pair<A, B>* address,
|
||||
BOOST_FWD_REF(A0) a0)
|
||||
{
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->first),boost::forward<A0>(a0));
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->second));
|
||||
}
|
||||
|
||||
template <typename Alloc, typename A, typename B,
|
||||
typename A0, typename A1, typename A2>
|
||||
inline typename enable_if<emulation3<A, B, A0>, void>::type
|
||||
construct_value_impl(Alloc& alloc, std::pair<A, B>* address,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->first),boost::forward<A0>(a0));
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->second),
|
||||
boost::forward<A1>(a1),
|
||||
boost::forward<A2>(a2));
|
||||
}
|
||||
|
||||
template <typename Alloc, typename A, typename B,
|
||||
typename A0, typename A1, typename A2, typename A3,
|
||||
typename... Args>
|
||||
inline void construct_value_impl(Alloc& alloc, std::pair<A, B>* address,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2,
|
||||
BOOST_FWD_REF(A3) a3, BOOST_FWD_REF(Args)... args)
|
||||
{
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->first),boost::forward<A0>(a0));
|
||||
boost::unordered::detail::call_construct(alloc,
|
||||
boost::addressof(address->second),
|
||||
boost::forward<A1>(a1),
|
||||
boost::forward<A2>(a2),
|
||||
boost::forward<A3>(a3),
|
||||
boost::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
|
||||
#else // BOOST_NO_VARIADIC_TEMPLATES
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1107,58 +1037,6 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
|
||||
boost::addressof(address->second), args.a2);
|
||||
}
|
||||
|
||||
#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
|
||||
|
||||
template <typename Alloc, typename A, typename B, typename A0>
|
||||
inline void construct_value_impl(Alloc&, std::pair<A, B>* address,
|
||||
boost::unordered::detail::emplace_args1<A0> const& args,
|
||||
typename enable_if<emulation1<A, B, A0>, void*>::type = 0)
|
||||
{
|
||||
new((void*) boost::addressof(address->first)) A(
|
||||
boost::forward<A0>(args.a0));
|
||||
new((void*) boost::addressof(address->second)) B();
|
||||
}
|
||||
|
||||
template <typename Alloc, typename A, typename B,
|
||||
typename A0, typename A1, typename A2>
|
||||
inline void construct_value_impl(Alloc&, std::pair<A, B>* address,
|
||||
boost::unordered::detail::emplace_args3<A0, A1, A2> const& args,
|
||||
typename enable_if<emulation3<A, B, A0>, void*>::type = 0)
|
||||
{
|
||||
new((void*) boost::addressof(address->first)) A(
|
||||
boost::forward<A0>(args.a0));
|
||||
new((void*) boost::addressof(address->second)) B(
|
||||
boost::forward<A1>(args.a1),
|
||||
boost::forward<A2>(args.a2));
|
||||
}
|
||||
|
||||
#define BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(z, num_params, _) \
|
||||
template <typename Alloc, typename A, typename B, \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
|
||||
> \
|
||||
inline void construct_value_impl(Alloc&, std::pair<A, B>* address, \
|
||||
boost::unordered::detail::BOOST_PP_CAT(emplace_args, num_params) < \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
|
||||
> const& args) \
|
||||
{ \
|
||||
new((void*) boost::addressof(address->first)) A( \
|
||||
boost::forward<A0>(args.a0)); \
|
||||
new((void*) boost::addressof(address->second)) B( \
|
||||
BOOST_PP_ENUM_##z(BOOST_PP_DEC(num_params), \
|
||||
BOOST_UNORDERED_CALL_FORWARD2, args.a)); \
|
||||
}
|
||||
|
||||
#define BOOST_UNORDERED_CALL_FORWARD2(z, i, a) \
|
||||
BOOST_UNORDERED_CALL_FORWARD(z, BOOST_PP_INC(i), a)
|
||||
|
||||
BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(1, 2, _)
|
||||
BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
|
||||
BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL, _)
|
||||
|
||||
#undef BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL
|
||||
#undef BOOST_UNORDERED_CALL_FORWARD2
|
||||
|
||||
#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
|
||||
#endif // BOOST_NO_VARIADIC_TEMPLATES
|
||||
|
||||
}}}
|
||||
|
@@ -93,11 +93,6 @@ namespace detail {
|
||||
return v.first;
|
||||
}
|
||||
|
||||
static key_type const& extract(key_type const& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <class Second>
|
||||
static key_type const& extract(std::pair<key_type, Second> const& v)
|
||||
{
|
||||
@@ -111,14 +106,13 @@ namespace detail {
|
||||
return v.first;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
template <class Arg1, class... Args>
|
||||
static key_type const& extract(key_type const& k,
|
||||
Arg1 const&, Args const&...)
|
||||
template <class Arg1>
|
||||
static key_type const& extract(key_type const& k, Arg1 const&)
|
||||
{
|
||||
return k;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
template <class... Args>
|
||||
static no_key extract(Args const&...)
|
||||
{
|
||||
@@ -126,12 +120,6 @@ namespace detail {
|
||||
}
|
||||
#else
|
||||
|
||||
template <class Arg1>
|
||||
static key_type const& extract(key_type const& k, Arg1 const&)
|
||||
{
|
||||
return k;
|
||||
}
|
||||
|
||||
static no_key extract()
|
||||
{
|
||||
return no_key();
|
||||
@@ -195,7 +183,6 @@ BOOST_UNORDERED_KEY_FROM_TUPLE(boost::)
|
||||
BOOST_UNORDERED_KEY_FROM_TUPLE(std::)
|
||||
#endif
|
||||
|
||||
|
||||
static bool compare_mapped(value_type const& x, value_type const& y)
|
||||
{
|
||||
return x.second == y.second;
|
||||
|
Reference in New Issue
Block a user