1 AC_DEFUN([AC_CXX_FUNCTION_NONTYPE_PARAMETERS],
2 [AC_CACHE_CHECK(whether the compiler supports function templates with non-type parameters,
3 ac_cv_cxx_function_nontype_parameters,
7 template<class T, int N> class A {};
8 template<class T, int N> int f(const A<T,N>& x) { return 0; }
9 ],[A<double, 17> z; return f(z);],
10 ac_cv_cxx_function_nontype_parameters=yes, ac_cv_cxx_function_nontype_parameters=no)
13 if test "$ac_cv_cxx_function_nontype_parameters" = yes; then
14 AC_DEFINE(HAVE_FUNCTION_NONTYPE_PARAMETERS,,
15 [define if the compiler supports function templates with non-type parameters])
19 AC_DEFUN([AC_CXX_NAMESPACES],
20 [AC_CACHE_CHECK(whether the compiler implements namespaces,
24 AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
25 [using namespace Outer::Inner; return i;],
26 ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
29 if test "$ac_cv_cxx_namespaces" = yes; then
30 AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
34 AC_DEFUN([AC_CXX_HAVE_COMPLEX],
35 [AC_CACHE_CHECK(whether the compiler has complex<T>,
36 ac_cv_cxx_have_complex,
37 [AC_REQUIRE([AC_CXX_NAMESPACES])
40 AC_TRY_COMPILE([#include <complex>
41 #ifdef HAVE_NAMESPACES
43 #endif],[complex<float> a; complex<double> b; return 0;],
44 ac_cv_cxx_have_complex=yes, ac_cv_cxx_have_complex=no)
47 if test "$ac_cv_cxx_have_complex" = yes; then
48 AC_DEFINE(HAVE_COMPLEX,,[define if the compiler has complex<T>])
52 AC_DEFUN([AC_CXX_HAVE_SSTREAM],
53 [AC_CACHE_CHECK(whether the compiler has stringstream,
54 ac_cv_cxx_have_sstream,
55 [AC_REQUIRE([AC_CXX_NAMESPACES])
58 AC_TRY_COMPILE([#include <sstream>
59 #ifdef HAVE_NAMESPACES
61 #endif],[stringstream message; message << "Hello"; return 0;],
62 ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
65 if test "$ac_cv_cxx_have_sstream" = yes; then
66 AC_DEFINE(HAVE_SSTREAM,,[define if the compiler has stringstream])
70 AC_DEFUN([AC_CXX_MUTABLE],
71 [AC_CACHE_CHECK(whether the compiler supports the mutable keyword,
76 class A { mutable int i;
78 int f (int n) const { i = n; return i; }
80 ],[A a; return a.f (1);],
81 ac_cv_cxx_mutable=yes, ac_cv_cxx_mutable=no)
84 if test "$ac_cv_cxx_mutable" = yes; then
85 AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword])