diff options
Diffstat (limited to 'boost/hana/config.hpp')
-rw-r--r-- | boost/hana/config.hpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/boost/hana/config.hpp b/boost/hana/config.hpp index 6cf6ace710..bf70920b47 100644 --- a/boost/hana/config.hpp +++ b/boost/hana/config.hpp @@ -124,14 +124,21 @@ Distributed under the Boost Software License, Version 1.0. // Caveats and other compiler-dependent options ////////////////////////////////////////////////////////////////////////////// -// BOOST_HANA_CONFIG_HAS_CONSTEXPR_LAMBDA enables some constructs requiring -// `constexpr` lambdas, which are not in the language (yet). -// Currently always disabled. +// `BOOST_HANA_CONFIG_HAS_CONSTEXPR_LAMBDA` enables some constructs requiring +// `constexpr` lambdas, which are in the language starting with C++17. // -// BOOST_HANA_CONSTEXPR_LAMBDA expands to `constexpr` if constexpr lambdas +// Always disabled for now because Clang only has partial support for them +// (captureless lambdas only). +#if defined(__cplusplus) && __cplusplus > 201402L +# define BOOST_HANA_CONSTEXPR_STATELESS_LAMBDA constexpr +// # define BOOST_HANA_CONFIG_HAS_CONSTEXPR_LAMBDA +#else +# define BOOST_HANA_CONSTEXPR_STATELESS_LAMBDA /* nothing */ +#endif + +// `BOOST_HANA_CONSTEXPR_LAMBDA` expands to `constexpr` if constexpr lambdas // are supported and to nothing otherwise. -#if 0 -# define BOOST_HANA_CONFIG_HAS_CONSTEXPR_LAMBDA +#if defined(BOOST_HANA_CONFIG_HAS_CONSTEXPR_LAMBDA) # define BOOST_HANA_CONSTEXPR_LAMBDA constexpr #else # define BOOST_HANA_CONSTEXPR_LAMBDA /* nothing */ |