From 9286cfa8cce6dcfd7ede7a0b7a2c856e98b4f62a Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Wed, 24 Jan 2018 23:05:23 +0100 Subject: [PATCH] Feature detection placeholders --- include/continuable/detail/features.hpp | 15 +++++++++++---- test/unit-test/test-continuable.hpp | 3 +-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/continuable/detail/features.hpp b/include/continuable/detail/features.hpp index 16035fa..b083dae 100644 --- a/include/continuable/detail/features.hpp +++ b/include/continuable/detail/features.hpp @@ -55,10 +55,17 @@ #undef CONTINUABLE_WITH_EXCEPTIONS #endif -/// TODO Enable this -#undef CONTINUABLE_HAS_CXX17_CONSTEXPR_IF -/// TODO Enable this -#undef CONTINUABLE_HAS_CXX17_FOLD_EXPRESSION +#if defined(__has_feature) +#if __has_feature(cxx_if_constexpr) +// PR not merged into the clang master yet +#define CONTINUABLE_HAS_CXX17_CONSTEXPR_IF +#endif + +#if __has_feature(cxx_fold_expressions) +// PR not merged into the clang master yet +#define CONTINUABLE_HAS_CXX17_FOLD_EXPRESSION +#endif +#endif /// This is enabled by the CMake project // #undef CONTINUABLE_HAS_EXPERIMENTAL_COROUTINE diff --git a/test/unit-test/test-continuable.hpp b/test/unit-test/test-continuable.hpp index 803b33f..b06dcda 100644 --- a/test/unit-test/test-continuable.hpp +++ b/test/unit-test/test-continuable.hpp @@ -207,8 +207,7 @@ auto make_step(T* me, unsigned& current, unsigned step) { #if !defined(CONTINUABLE_WITH_NO_EXCEPTIONS) struct test_exception : std::exception { - explicit test_exception() { - } + explicit test_exception() = default; bool operator==(test_exception const&) const noexcept { return true;