From fc1604f2c8a1c3b28dd43d5202e58197796f8fff Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 19 May 2017 17:24:44 +0100 Subject: [PATCH] Don't use allocator_traits::construct on GCC 4.6 Piecewise construction doesn't work uncopyable types. --- include/boost/unordered/detail/implementation.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index a681f9a3..54333400 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -150,6 +150,9 @@ // Sun C++ std::pair piecewise construction doesn't seem to be exception safe. // (At least for Sun C++ 12.5 using libstdc++). #define BOOST_UNORDERED_CXX11_CONSTRUCTION 0 +#elif BOOST_COMP_GNUC && BOOST_COMP_GNUC < BOOST_VERSION_NUMBER(4, 7, 0) +// Piecewise construction in GCC 4.6 doesn't work for uncopyable types. +#define BOOST_UNORDERED_CXX11_CONSTRUCTION 0 #elif BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 0 && \ !defined(BOOST_NO_SFINAE_EXPR) #define BOOST_UNORDERED_CXX11_CONSTRUCTION 1