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.

45 lines
1.6KB

  1. # ==================================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_cxx_partial_specialization.html
  3. # ==================================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_CXX_PARTIAL_SPECIALIZATION
  8. #
  9. # DESCRIPTION
  10. #
  11. # If the compiler supports partial specialization, define
  12. # HAVE_PARTIAL_SPECIALIZATION.
  13. #
  14. # LICENSE
  15. #
  16. # Copyright (c) 2008 Todd Veldhuizen
  17. # Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
  18. #
  19. # Copying and distribution of this file, with or without modification, are
  20. # permitted in any medium without royalty provided the copyright notice
  21. # and this notice are preserved. This file is offered as-is, without any
  22. # warranty.
  23. #serial 7
  24. AU_ALIAS([AC_CXX_PARTIAL_SPECIALIZATION], [AX_CXX_PARTIAL_SPECIALIZATION])
  25. AC_DEFUN([AX_CXX_PARTIAL_SPECIALIZATION],
  26. [AC_CACHE_CHECK(whether the compiler supports partial specialization,
  27. ax_cv_cxx_partial_specialization,
  28. [AC_LANG_SAVE
  29. AC_LANG_CPLUSPLUS
  30. AC_TRY_COMPILE([
  31. template<class T, int N> class A { public : enum e { z = 0 }; };
  32. template<int N> class A<double, N> { public : enum e { z = 1 }; };
  33. template<class T> class A<T, 2> { public : enum e { z = 2 }; };
  34. ],[return (A<int,3>::z == 0) && (A<double,3>::z == 1) && (A<float,2>::z == 2);],
  35. ax_cv_cxx_partial_specialization=yes, ax_cv_cxx_partial_specialization=no)
  36. AC_LANG_RESTORE
  37. ])
  38. if test "$ax_cv_cxx_partial_specialization" = yes; then
  39. AC_DEFINE(HAVE_PARTIAL_SPECIALIZATION,,
  40. [define if the compiler supports partial specialization])
  41. fi
  42. ])