Remove BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT

This commit is contained in:
Christian Mazakas
2023-08-29 12:39:51 -07:00
parent f088a5b9b9
commit 8782036a88
8 changed files with 33 additions and 104 deletions

View File

@@ -14,52 +14,7 @@
#include <boost/predef.h>
#if defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
// Already defined.
#elif defined(BOOST_LIBSTDCXX11)
// https://github.com/gcc-mirror/gcc/blob/gcc-4_6-branch/libstdc++-v3/include/bits/stl_pair.h#L70
#if BOOST_LIBSTDCXX_VERSION > 40600
#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
#endif
#elif BOOST_LIB_STD_CXX
// https://github.com/llvm-mirror/libcxx/blob/release_30/include/utility#L206
#if BOOST_LIB_STD_CXX >= BOOST_VERSION_NUMBER(3, 0, 0)
#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
#endif
#elif defined(BOOST_LIB_STD_DINKUMWARE)
// Apparently C++11 standard supported in Visual Studio 2012
// https://msdn.microsoft.com/en-us/library/hh567368.aspx#stl
// 2012 = VC+11 = BOOST_MSVC 1700 Hopefully!
// I have no idea when Dinkumware added it, probably a lot
// earlier than this check.
#if BOOST_LIB_STD_DINKUMWARE >= BOOST_VERSION_NUMBER(6, 10, 0) || \
BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(17, 0, 0)
#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
#endif
#endif
// Assume that an unknown library does not support piecewise construction.
#if !defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 0
#endif
#if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
#include <utility>
#endif
namespace boost {
namespace unordered {
#if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
using std::piecewise_construct_t;
using std::piecewise_construct;
#else
struct piecewise_construct_t
{
};
const piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
}
}
// BOOST_UNORDERED_EMPLACE_LIMIT = The maximum number of parameters in
// emplace (not including things like hints). Don't set it to a lower value, as

View File

@@ -646,7 +646,7 @@ namespace boost {
template <typename A0> struct use_piecewise
{
static choice1::type test(
choice1, boost::unordered::piecewise_construct_t);
choice1, std::piecewise_construct_t);
static choice2::type test(choice2, ...);
@@ -3080,7 +3080,7 @@ namespace boost {
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
template <typename T2> \
static no_key extract(boost::unordered::piecewise_construct_t, \
static no_key extract(std::piecewise_construct_t, \
namespace_ tuple<> const&, T2 const&) \
{ \
return no_key(); \
@@ -3088,7 +3088,7 @@ namespace boost {
\
template <typename T, typename T2> \
static typename is_key<key_type, T>::type extract( \
boost::unordered::piecewise_construct_t, namespace_ tuple<T> const& k, \
std::piecewise_construct_t, namespace_ tuple<T> const& k, \
T2 const&) \
{ \
return typename is_key<key_type, T>::type(namespace_ get<0>(k)); \
@@ -3098,14 +3098,14 @@ namespace boost {
#define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
static no_key extract( \
boost::unordered::piecewise_construct_t, namespace_ tuple<> const&) \
std::piecewise_construct_t, namespace_ tuple<> const&) \
{ \
return no_key(); \
} \
\
template <typename T> \
static typename is_key<key_type, T>::type extract( \
boost::unordered::piecewise_construct_t, namespace_ tuple<T> const& k) \
std::piecewise_construct_t, namespace_ tuple<T> const& k) \
{ \
return typename is_key<key_type, T>::type(namespace_ get<0>(k)); \
}