Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_templates.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_TEMPLATES
  8. #
  9. # DESCRIPTION
  10. #
  11. # If the compiler supports basic templates, define HAVE_TEMPLATES.
  12. #
  13. # LICENSE
  14. #
  15. # Copyright (c) 2008 Todd Veldhuizen
  16. # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
  17. #
  18. # Copying and distribution of this file, with or without modification, are
  19. # permitted in any medium without royalty provided the copyright notice
  20. # and this notice are preserved. This file is offered as-is, without any
  21. # warranty.
  22. #serial 8
  23. AU_ALIAS([AC_CXX_TEMPLATES], [AX_CXX_TEMPLATES])
  24. AC_DEFUN([AX_CXX_TEMPLATES],
  25. [dnl
  26. AC_CACHE_CHECK([whether the compiler supports basic templates],
  27. [ax_cv_cxx_templates],
  28. [AC_LANG_PUSH([C++])
  29. AC_COMPILE_IFELSE([dnl
  30. AC_LANG_PROGRAM([
  31. template<class T> class A {public:A(){};};
  32. template<class T> void f(const A<T>& ){};
  33. ],
  34. [A<double> d; A<int> i; f(d); f(i); return 0;])],
  35. [ax_cv_cxx_templates=yes],
  36. [ax_cv_cxx_templates=no])
  37. AC_LANG_POP([C++])
  38. ])
  39. AS_IF([test "X$ax_cv_cxx_templates" = "Xyes"],
  40. [AC_DEFINE(HAVE_TEMPLATES,,[define if the compiler supports basic templates])])
  41. ])