From 6ae68fe3013c85cb53986d65ac0dd885af724559 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Tue, 13 Dec 2016 12:23:12 -0500 Subject: [PATCH] Add simple any_of/all_of implementation for C++17 --- include/pybind11/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/pybind11/common.h b/include/pybind11/common.h index 254fbadd..bfc5f133 100644 --- a/include/pybind11/common.h +++ b/include/pybind11/common.h @@ -385,7 +385,10 @@ template using negation = bool_constant; #endif /// Compile-time all/any/none of that check the ::value of all template types -#if !defined(_MSC_VER) +#ifdef PYBIND11_CPP17 +template using all_of = bool_constant<(Ts::value && ...)>; +template using any_of = bool_constant<(Ts::value || ...)>; +#elif !defined(_MSC_VER) template struct bools {}; template using all_of = std::is_same< bools,