# Test that the c++17 attributes are supported.
CHECK_CXX_SOURCE_COMPILES(
"
+ #include <cmath>
#include <iostream>
+ #include <optional>
+ #include <tuple>
#if __cplusplus < 201703L && !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
# error \"insufficient support for C++17\"
#endif
+ //check for some C++17 features that we use in our headers:
+ using std::apply;
+ using std::cyl_bessel_j;
+ using std::cyl_bessel_jf;
+ using std::cyl_bessel_jl;
+ using std::optional;
+
[[nodiscard]] int test_nodiscard()
{
return 1;
#include <deal.II/base/config.h>
-#ifndef __cpp_lib_math_special_functions
+#ifdef DEAL_II_HAVE_CXX17
+# include <cmath>
+#else
# include <boost/math/special_functions/bessel.hpp>
-#endif // __cpp_lib_math_special_functions
+#endif
-#include <cmath>
DEAL_II_NAMESPACE_OPEN
namespace std_cxx17
{
-#ifndef __cpp_lib_math_special_functions
+#ifndef DEAL_II_HAVE_CXX17
double (&cyl_bessel_j)(double,
double) = boost::math::cyl_bessel_j<double, double>;
float (&cyl_bessel_jf)(float,
using std::cyl_bessel_j;
using std::cyl_bessel_jf;
using std::cyl_bessel_jl;
-#endif // __cpp_lib_math_special_functions
+#endif
} // namespace std_cxx17
DEAL_II_NAMESPACE_CLOSE
#include <deal.II/base/config.h>
-#ifdef __cpp_lib_optional
+#ifdef DEAL_II_HAVE_CXX17
# include <optional>
#else
# include <boost/optional.hpp>
DEAL_II_NAMESPACE_OPEN
namespace std_cxx17
{
-#ifdef __cpp_lib_optional
- using std::optional;
-#else
+#ifndef DEAL_II_HAVE_CXX17
using boost::optional;
+#else
+ using std::optional;
#endif
} // namespace std_cxx17
DEAL_II_NAMESPACE_CLOSE
#include <tuple>
-#ifndef __cpp_lib_apply
-# include <utility>
-#endif // __cpp_lib_apply
-
DEAL_II_NAMESPACE_OPEN
namespace std_cxx17
{
-#ifndef __cpp_lib_apply
+#ifndef DEAL_II_HAVE_CXX17
template <typename F, typename Tuple, size_t... S>
auto
apply_impl(F &&fn, Tuple &&t, std::index_sequence<S...>)
}
#else
using std::apply;
-#endif // __cpp_lib_apply
+#endif
} // namespace std_cxx17
DEAL_II_NAMESPACE_CLOSE