3 # Look for is_sorted in std:: and __gnu_cxx:: and define
4 # some things to make it easy to find later.
5 AC_DEFUN([CHECK_FOR_IS_SORTED], [
6 AC_MSG_CHECKING([where we can find is_sorted])
9 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <algorithm>],
10 [std::is_sorted((int*)0L, (int*)0L);])],
11 [is_sorted_result=std],
12 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <ext/algorithm>],
13 [__gnu_cxx::is_sorted((int*)0L, (int*)0L);])],
14 [is_sorted_result=__gnu_cxx],
15 [AC_MSG_FAILURE([cannot find std::is_sorted() or __gnu_cxx::is_sorted()])])])
17 AC_MSG_RESULT($is_sorted_result)
18 if test "$is_sorted_result" = __gnu_cxx; then is_sorted_result=1; else is_sorted_result=0; fi
19 AC_DEFINE_UNQUOTED([IS_SORTED_IN_GNUCXX_NAMESPACE], $is_sorted_result, [Define to 1 if __gnu_cxx::is_sorted() exists])
20 ])# CHECK_FOR_IS_SORTED