From 68e089a8bf84535bf3d2a2e0dae1cf9607624463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 17 Mar 2017 14:51:41 +0100 Subject: [PATCH] Use custom definitions for negation and bool_constant (#737) Instead of relying on sometimes missing C++17 definitions --- include/pybind11/common.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 44b7008e..850aa61e 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -396,13 +396,9 @@ template struct make_index_sequence_impl <0, S...> { typedef index_ template using make_index_sequence = typename make_index_sequence_impl::type; #endif -#if defined(PYBIND11_CPP17) || defined(_MSC_VER) -using std::bool_constant; -using std::negation; -#else +/// Backports of std::bool_constant and std::negation to accomodate older compilers template using bool_constant = std::integral_constant; -template using negation = bool_constant; -#endif +template struct negation : bool_constant { }; /// Compile-time all/any/none of that check the boolean value of all template types #ifdef PYBIND11_CPP17