Skip to content
Snippets Groups Projects
Commit 689b1ef2 authored by Christian Engwer's avatar Christian Engwer
Browse files

add test for variadic templates

[[Imported from SVN: r6307]]
parent b44cb304
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ ALLM4S = \ ...@@ -14,6 +14,7 @@ ALLM4S = \
cxx0x_compiler.m4 \ cxx0x_compiler.m4 \
cxx0x_nullptr.m4 \ cxx0x_nullptr.m4 \
cxx0x_static_assert.m4 \ cxx0x_static_assert.m4 \
cxx0x_variadic.m4 \
dune.m4 \ dune.m4 \
dune_all.m4 \ dune_all.m4 \
dune_autobuild.m4 \ dune_autobuild.m4 \
......
# tests for C++0x variadic template support
# the associated macro is called HAVE_VARIADIC_TEMPLATES
AC_DEFUN([VARIADIC_TEMPLATES_CHECK],[
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether variadic templates are supported])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([#include<cassert>
template<typename... T>
int addints(T... x);
int add_ints()
{
return 0;
}
template<typename T1, typename... T>
int add_ints(T1 t1, T... t)
{
return t1 + add_ints(t...);
}],
[
assert( 5 == add_ints(9,3,-5,-2) );
return 0;
])],[
HAVE_VARIADIC_TEMPLATES=yes
AC_MSG_RESULT(yes)], [
HAVE_VARIADIC_TEMPLATES=no
AC_MSG_RESULT(no)])
if test "x$HAVE_VARIADIC_TEMPLATES" = xyes; then
AC_DEFINE(HAVE_VARIADIC_TEMPLATES, 1, [Define to 1 if nullptr is supported])
fi
AC_LANG_POP
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment