aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-12 14:04:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-12 14:04:07 +0100
commitc3be2c0c889153faa7e5fd69defa5678a873a3e9 (patch)
tree65c468a87863e62d8d646266b711e5e3ba8185f1
parent424de06050ce295a5d1a3dbeb8d49e1735b4ffa1 (diff)
downloadpaludis-c3be2c0c889153faa7e5fd69defa5678a873a3e9.tar.gz
paludis-c3be2c0c889153faa7e5fd69defa5678a873a3e9.tar.xz
0x has std::next, which messes with paludis::next because of ADL.
-rw-r--r--configure.ac20
-rw-r--r--paludis/util/iterator_funcs.hh4
2 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b13e597..26cc6fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,6 +329,26 @@ int main(int, char **)
AC_MSG_ERROR([Your compiler doesn't support tr1 functional])])
dnl }}}
+dnl {{{ std::next
+AC_MSG_CHECKING([for std::next])
+AC_COMPILE_IFELSE([
+#include <algorithm>
+#include <iterator>
+#include <list>
+int main(int, char **)
+{
+ std::list<int> x;
+ next(x.begin());
+}
+],
+ [AC_MSG_RESULT([yes])
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_HAVE_STD_NEXT=1"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_HAVE_STD_NEXT=1"
+ ],
+ [AC_MSG_RESULT([no])
+ ])
+dnl }}}
+
need_xml_check=
need_pcrepp_check=
need_syck_check=
diff --git a/paludis/util/iterator_funcs.hh b/paludis/util/iterator_funcs.hh
index dbc9e7a..d125f6a 100644
--- a/paludis/util/iterator_funcs.hh
+++ b/paludis/util/iterator_funcs.hh
@@ -29,6 +29,9 @@
namespace paludis
{
+#ifdef PALUDIS_HAVE_STD_NEXT
+ using std::next;
+#else
/**
* Return a new iterator pointing to the item after i.
*
@@ -59,6 +62,7 @@ namespace paludis
std::advance(result, n);
return result;
}
+#endif
/**
* Return a new iterator pointing to the item before i.