Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/kernel.git] / salome_adm / unix / config_files / ac_cxx_partial_specialization.m4
1 dnl @synopsis AC_CXX_PARTIAL_SPECIALIZATION
2 dnl
3 dnl If the compiler supports partial specialization,
4 dnl define HAVE_PARTIAL_SPECIALIZATION.
5 dnl
6 dnl @version $Id$
7 dnl @author Luc Maisonobe
8 dnl
9 AC_DEFUN(AC_CXX_PARTIAL_SPECIALIZATION,
10 [AC_CACHE_CHECK(whether the compiler supports partial specialization,
11 ac_cv_cxx_partial_specialization,
12 [AC_LANG_SAVE
13  AC_LANG_CPLUSPLUS
14  AC_TRY_COMPILE([
15 template<class T, int N> class A            { public : enum e { z = 0 }; };
16 template<int N>          class A<double, N> { public : enum e { z = 1 }; };
17 template<class T>        class A<T, 2>      { public : enum e { z = 2 }; };
18 ],[return (A<int,3>::z == 0) && (A<double,3>::z == 1) && (A<float,2>::z == 2);],
19  ac_cv_cxx_partial_specialization=yes, ac_cv_cxx_partial_specialization=no)
20  AC_LANG_RESTORE
21 ])
22 if test "$ac_cv_cxx_partial_specialization" = yes; then
23   AC_DEFINE(HAVE_PARTIAL_SPECIALIZATION,,
24             [define if the compiler supports partial specialization])
25 fi
26 ])