diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 44b7008e4..850aa61e6 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