blob: 38a611764c790dd8e19ee7edc01ed7fa7374505e [file] [log] [blame]
Reid Spencer491f6812004-09-07 06:56:14 +00001# Check for standard iterator extension. This is modified from
2# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
3AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
4[AC_CACHE_CHECK(whether the compiler has the standard iterator,
5ac_cv_cxx_have_std_iterator,
6[AC_REQUIRE([AC_CXX_NAMESPACES])
Reid Spencer12de17d2004-09-19 22:31:49 +00007 AC_LANG_PUSH([C++])
8 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
9 [[#include <iterator>
Reid Spencer491f6812004-09-07 06:56:14 +000010#ifdef HAVE_NAMESPACES
11using namespace std;
Reid Spencer12de17d2004-09-19 22:31:49 +000012#endif]],
13 [[iterator<int,int,int> t; return 0;]])],
14 ac_cv_cxx_have_std_iterator=yes,
15 ac_cv_cxx_have_std_iterator=no)
16 AC_LANG_POP([C++])
Reid Spencer491f6812004-09-07 06:56:14 +000017])
Reid Spencer491f6812004-09-07 06:56:14 +000018if test "$ac_cv_cxx_have_std_iterator" = yes
19then
John Criswell40468462004-09-24 21:19:06 +000020 AC_DEFINE(HAVE_STD_ITERATOR,1,[Have std namespace iterator])
21else
22 AC_DEFINE(HAVE_STD_ITERATOR,0,[Does not have std namespace iterator])
Reid Spencer491f6812004-09-07 06:56:14 +000023fi
John Criswell40468462004-09-24 21:19:06 +000024])
Reid Spencer491f6812004-09-07 06:56:14 +000025
26