Remove BOOST_UNORDERED_TUPLE_ARGS

This commit is contained in:
Christian Mazakas
2023-08-30 11:23:50 -07:00
parent 1d991d065e
commit 3bd7e93ac6
3 changed files with 7 additions and 69 deletions

View File

@ -35,39 +35,6 @@
#endif
#endif
// BOOST_UNORDERED_TUPLE_ARGS
//
// Maximum number of std::tuple members to support, or 0 if std::tuple
// isn't avaiable. More are supported when full C++11 is used.
// Already defined, so do nothing
#if defined(BOOST_UNORDERED_TUPLE_ARGS)
// Assume if we have C++11 tuple it's properly variadic,
// and just use a max number of 10 arguments.
#elif !defined(BOOST_NO_CXX11_HDR_TUPLE)
#define BOOST_UNORDERED_TUPLE_ARGS 10
// Visual C++ has a decent enough tuple for piecewise construction,
// so use that if available, using _VARIADIC_MAX for the maximum
// number of parameters. Note that this comes after the check
// for a full C++11 tuple.
#elif defined(BOOST_MSVC)
#if !BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
#define BOOST_UNORDERED_TUPLE_ARGS 0
#elif defined(_VARIADIC_MAX)
#define BOOST_UNORDERED_TUPLE_ARGS _VARIADIC_MAX
#else
#define BOOST_UNORDERED_TUPLE_ARGS 5
#endif
// Assume that we don't have std::tuple
#else
#define BOOST_UNORDERED_TUPLE_ARGS 0
#endif
#if BOOST_UNORDERED_TUPLE_ARGS
#include <tuple>
#endif
#endif

View File

@ -645,8 +645,7 @@ namespace boost {
template <typename A0> struct use_piecewise
{
static choice1::type test(
choice1, std::piecewise_construct_t);
static choice1::type test(choice1, std::piecewise_construct_t);
static choice2::type test(choice2, ...);
@ -2205,9 +2204,9 @@ namespace boost {
return emplace_return(iterator(p, itb), false);
}
node_tmp b(boost::unordered::detail::func::construct_node_pair(
this->node_alloc(), std::forward<Key>(k),
std::forward<M>(obj)),
node_tmp b(
boost::unordered::detail::func::construct_node_pair(
this->node_alloc(), std::forward<Key>(k), std::forward<M>(obj)),
node_alloc());
if (size_ + 1 > max_load_) {
@ -3076,47 +3075,23 @@ namespace boost {
}
#endif
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
template <typename T2> \
static no_key extract(std::piecewise_construct_t, \
namespace_ tuple<> const&, T2 const&) \
static no_key extract( \
std::piecewise_construct_t, namespace_ tuple<> const&, T2 const&) \
{ \
return no_key(); \
} \
\
template <typename T, typename T2> \
static typename is_key<key_type, T>::type extract( \
std::piecewise_construct_t, namespace_ tuple<T> const& k, \
T2 const&) \
std::piecewise_construct_t, namespace_ tuple<T> const& k, T2 const&) \
{ \
return typename is_key<key_type, T>::type(namespace_ get<0>(k)); \
}
#else
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
static no_key extract( \
std::piecewise_construct_t, namespace_ tuple<> const&) \
{ \
return no_key(); \
} \
\
template <typename T> \
static typename is_key<key_type, T>::type extract( \
std::piecewise_construct_t, namespace_ tuple<T> const& k) \
{ \
return typename is_key<key_type, T>::type(namespace_ get<0>(k)); \
}
#endif
BOOST_UNORDERED_KEY_FROM_TUPLE(boost::)
#if BOOST_UNORDERED_TUPLE_ARGS
BOOST_UNORDERED_KEY_FROM_TUPLE(std::)
#endif
#undef BOOST_UNORDERED_KEY_FROM_TUPLE
};

View File

@ -542,8 +542,6 @@ namespace unnecessary_copy_tests {
COPY_COUNT(0);
MOVE_COUNT(0);
#if BOOST_UNORDERED_TUPLE_ARGS
reset();
x.emplace(std::piecewise_construct,
std::make_tuple(std::ref(b.first)), std::make_tuple(std::ref(b.second)));
@ -573,8 +571,6 @@ namespace unnecessary_copy_tests {
std::forward_as_tuple(b.first), std::forward_as_tuple(b.second));
COPY_COUNT(0);
MOVE_COUNT(0);
#endif
#endif
}
}