forked from boostorg/unordered
Remove BOOST_UNORDERED_TUPLE_ARGS
This commit is contained in:
@ -35,39 +35,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#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>
|
#include <tuple>
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -645,8 +645,7 @@ namespace boost {
|
|||||||
|
|
||||||
template <typename A0> struct use_piecewise
|
template <typename A0> struct use_piecewise
|
||||||
{
|
{
|
||||||
static choice1::type test(
|
static choice1::type test(choice1, std::piecewise_construct_t);
|
||||||
choice1, std::piecewise_construct_t);
|
|
||||||
|
|
||||||
static choice2::type test(choice2, ...);
|
static choice2::type test(choice2, ...);
|
||||||
|
|
||||||
@ -2205,9 +2204,9 @@ namespace boost {
|
|||||||
return emplace_return(iterator(p, itb), false);
|
return emplace_return(iterator(p, itb), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
node_tmp b(boost::unordered::detail::func::construct_node_pair(
|
node_tmp b(
|
||||||
this->node_alloc(), std::forward<Key>(k),
|
boost::unordered::detail::func::construct_node_pair(
|
||||||
std::forward<M>(obj)),
|
this->node_alloc(), std::forward<Key>(k), std::forward<M>(obj)),
|
||||||
node_alloc());
|
node_alloc());
|
||||||
|
|
||||||
if (size_ + 1 > max_load_) {
|
if (size_ + 1 > max_load_) {
|
||||||
@ -3076,47 +3075,23 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
|
||||||
|
|
||||||
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
|
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
|
||||||
template <typename T2> \
|
template <typename T2> \
|
||||||
static no_key extract(std::piecewise_construct_t, \
|
static no_key extract( \
|
||||||
namespace_ tuple<> const&, T2 const&) \
|
std::piecewise_construct_t, namespace_ tuple<> const&, T2 const&) \
|
||||||
{ \
|
{ \
|
||||||
return no_key(); \
|
return no_key(); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
template <typename T, typename T2> \
|
template <typename T, typename T2> \
|
||||||
static typename is_key<key_type, T>::type extract( \
|
static typename is_key<key_type, T>::type extract( \
|
||||||
std::piecewise_construct_t, namespace_ tuple<T> const& k, \
|
std::piecewise_construct_t, namespace_ tuple<T> const& k, T2 const&) \
|
||||||
T2 const&) \
|
|
||||||
{ \
|
{ \
|
||||||
return typename is_key<key_type, T>::type(namespace_ get<0>(k)); \
|
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::)
|
BOOST_UNORDERED_KEY_FROM_TUPLE(boost::)
|
||||||
|
|
||||||
#if BOOST_UNORDERED_TUPLE_ARGS
|
|
||||||
BOOST_UNORDERED_KEY_FROM_TUPLE(std::)
|
BOOST_UNORDERED_KEY_FROM_TUPLE(std::)
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef BOOST_UNORDERED_KEY_FROM_TUPLE
|
#undef BOOST_UNORDERED_KEY_FROM_TUPLE
|
||||||
};
|
};
|
||||||
|
@ -542,8 +542,6 @@ namespace unnecessary_copy_tests {
|
|||||||
COPY_COUNT(0);
|
COPY_COUNT(0);
|
||||||
MOVE_COUNT(0);
|
MOVE_COUNT(0);
|
||||||
|
|
||||||
#if BOOST_UNORDERED_TUPLE_ARGS
|
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
x.emplace(std::piecewise_construct,
|
x.emplace(std::piecewise_construct,
|
||||||
std::make_tuple(std::ref(b.first)), std::make_tuple(std::ref(b.second)));
|
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));
|
std::forward_as_tuple(b.first), std::forward_as_tuple(b.second));
|
||||||
COPY_COUNT(0);
|
COPY_COUNT(0);
|
||||||
MOVE_COUNT(0);
|
MOVE_COUNT(0);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user