diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 52534cd0..c407d950 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -27,14 +27,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -518,124 +510,6 @@ namespace boost { } // namespace unordered } // namespace boost -//////////////////////////////////////////////////////////////////////////// -// Construct from tuple -// -// Used to emulate piecewise construction. - -#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(z, n, namespace_) \ - template \ - void construct_from_tuple(Alloc&, T* ptr, \ - namespace_::tuple const& x) \ - { \ - new ((void*)ptr) \ - T(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_)); \ - } - -#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) namespace_::get(x) - -// construct_from_tuple for boost::tuple -// The workaround for old Sun compilers comes later in the file. - -#if !BOOST_UNORDERED_SUN_WORKAROUNDS1 - -namespace boost { - namespace unordered { - namespace detail { - namespace func { - template - void construct_from_tuple(Alloc&, T* ptr, boost::tuple<>) - { - new ((void*)ptr) T(); - } - - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 1, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 2, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 3, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 4, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 5, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 6, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 7, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 8, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 9, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 10, boost) - } // namespace func - } // namespace detail - } // namespace unordered -} // namespace boost - -#endif - -#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE -#undef BOOST_UNORDERED_GET_TUPLE_ARG - -// construct_from_tuple for boost::tuple on old versions of sunpro. -// -// Old versions of Sun C++ had problems with template overloads of -// boost::tuple, so to fix it I added a distinct type for each length to -// the overloads. That means there's no possible ambiguity between the -// different overloads, so that the compiler doesn't get confused - -#if BOOST_UNORDERED_SUN_WORKAROUNDS1 - -#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(z, n, namespace_) \ - template \ - void construct_from_tuple_impl(boost::unordered::detail::func::length, \ - Alloc&, T* ptr, \ - namespace_::tuple const& x) \ - { \ - new ((void*)ptr) \ - T(BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_)); \ - } - -#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) namespace_::get(x) - -namespace boost { - namespace unordered { - namespace detail { - namespace func { - template struct length - { - }; - - template - void construct_from_tuple_impl( - boost::unordered::detail::func::length<0>, Alloc&, T* ptr, - boost::tuple<>) - { - new ((void*)ptr) T(); - } - - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 1, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 2, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 3, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 4, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 5, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 6, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 7, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 8, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 9, boost) - BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(1, 10, boost) - - template - void construct_from_tuple(Alloc& alloc, T* ptr, Tuple const& x) - { - construct_from_tuple_impl(boost::unordered::detail::func::length< - boost::tuples::length::value>(), - alloc, ptr, x); - } - } // namespace func - } // namespace detail - } // namespace unordered -} // namespace boost - -#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE -#undef BOOST_UNORDERED_GET_TUPLE_ARG - -#endif - namespace boost { namespace unordered { namespace detail {