From f99dee19178eda18e15b9923e8bad366095d4f63 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 19 Dec 2017 12:11:36 +0000 Subject: [PATCH] Use predef for detecting piecewise construction And detect it for recent dinkumware. --- include/boost/unordered/detail/fwd.hpp | 13 +++++++++---- include/boost/unordered/detail/implementation.hpp | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/boost/unordered/detail/fwd.hpp b/include/boost/unordered/detail/fwd.hpp index 75030a9a..e749ce67 100644 --- a/include/boost/unordered/detail/fwd.hpp +++ b/include/boost/unordered/detail/fwd.hpp @@ -11,6 +11,8 @@ #pragma once #endif +#include + #if defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT) // Already defined. #elif defined(BOOST_LIBSTDCXX11) @@ -18,16 +20,19 @@ #if BOOST_LIBSTDCXX_VERSION > 40600 #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1 #endif -#elif defined(_LIBCPP_VERSION) +#elif BOOST_LIB_STD_CXX // https://github.com/llvm-mirror/libcxx/blob/release_30/include/utility#L206 -#if _LIBCPP_VERSION >= 3000 +#if BOOST_LIB_STD_CXX >= BOOST_VERSION_NUMBER(3, 0, 0) #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1 #endif -#elif defined(BOOST_MSVC) +#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! -#if BOOST_MSVC >= 1700 +// I have no idea when Dinkumware added it, probably a lot +// earlier than this check. +#if BOOST_LIB_STD_DINKUMWARE >= BOOST_VERSION_NUMBER(6, 50, 0) || \ + BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(17, 0, 0) #define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1 #endif #endif diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index fb1d4788..77d55b1d 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include