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

- add test for rvalue references

- fix config.h-comments for variadic templates

[[Imported from SVN: r6308]]
parent 689b1ef2
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ ALLM4S = \
ax_lang_compiler_ms.m4 \
boost_fusion.m4 \
cxx0x_compiler.m4 \
cxx0x_rvaluereference.m4 \
cxx0x_nullptr.m4 \
cxx0x_static_assert.m4 \
cxx0x_variadic.m4 \
......
# tests compiler support for C++0x rvalue references
# the associated macro is called HAVE_RVALUE_REFERENCES
AC_DEFUN([RVALUE_REFERENCES_CHECK],[
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether rvalue references are supported])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([#include<cassert>
#include <utility>
int foo(int&& x) { return 1; }
int foo(const int& x) { return -1; }
template<typename T>
int forward(T&& x)
{
return foo(std::forward<T>(x));
}],
[
int i = 0;
assert( forward(i) + forward(int(2)) == 0);
return 0;
])],[
HAVE_RVALUE_REFERENCES=yes
AC_MSG_RESULT(yes)], [
HAVE_RVALUE_REFERENCES=no
AC_MSG_RESULT(no)])
if test "x$HAVE_RVALUe_REFERENCES" = xyes; then
AC_DEFINE(HAVE_RVALUE_REFERENCES, 1, [Define to 1 if rvalue references are supported])
fi
AC_LANG_POP
])
......@@ -31,7 +31,7 @@ AC_DEFUN([VARIADIC_TEMPLATES_CHECK],[
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])
AC_DEFINE(HAVE_VARIADIC_TEMPLATES, 1, [Define to 1 if variadic templates are 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