aboutsummaryrefslogtreecommitdiff
path: root/libxsde
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-07 08:52:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-07 08:52:20 +0200
commit56043225000df52cf530a85dc5f53ad06ba241cd (patch)
tree9bf6a0090522896c0fa96baff61a574defcc7165 /libxsde
parentc1f810de13243f1b6b3a9e7c9313ceb936471e53 (diff)
Add support for STL-conforming iterators
The new XSDE_STL_ITERATOR configuration variable is used to conditionally turn this on.
Diffstat (limited to 'libxsde')
-rw-r--r--libxsde/xsde/cxx/hybrid/sequence.hxx15
-rw-r--r--libxsde/xsde/makefile5
2 files changed, 19 insertions, 1 deletions
diff --git a/libxsde/xsde/cxx/hybrid/sequence.hxx b/libxsde/xsde/cxx/hybrid/sequence.hxx
index 3c052e3..1f4e462 100644
--- a/libxsde/xsde/cxx/hybrid/sequence.hxx
+++ b/libxsde/xsde/cxx/hybrid/sequence.hxx
@@ -6,9 +6,14 @@
#ifndef XSDE_CXX_HYBRID_SEQUENCE_HXX
#define XSDE_CXX_HYBRID_SEQUENCE_HXX
+#include <xsde/cxx/config.hxx>
+
#include <stddef.h> // size_t, ptrdiff_t
-#include <xsde/cxx/config.hxx>
+#ifdef XSDE_STL_ITERATOR
+# include <iterator>
+#endif
+
#include <xsde/cxx/sequence-base.hxx>
#ifdef XSDE_STL
@@ -270,6 +275,10 @@ namespace xsde
typedef ptrdiff_t difference_type;
+#ifdef XSDE_STL_ITERATOR
+ typedef std::random_access_iterator_tag iterator_category;
+#endif
+
public:
var_iterator ()
: i_ (0)
@@ -377,6 +386,10 @@ namespace xsde
typedef ptrdiff_t difference_type;
+#ifdef XSDE_STL_ITERATOR
+ typedef std::random_access_iterator_tag iterator_category;
+#endif
+
public:
var_const_iterator ()
: i_ (0)
diff --git a/libxsde/xsde/makefile b/libxsde/xsde/makefile
index 845d206..f6cbaa2 100644
--- a/libxsde/xsde/makefile
+++ b/libxsde/xsde/makefile
@@ -522,6 +522,11 @@ ifeq ($(xsde_stl),y)
else
@echo '#undef XSDE_STL' >>$@
endif
+ifeq ($(xsde_stl_iterator),y)
+ @echo '#define XSDE_STL_ITERATOR' >>$@
+else
+ @echo '#undef XSDE_STL_ITERATOR' >>$@
+endif
ifeq ($(xsde_iostream),y)
@echo '#define XSDE_IOSTREAM' >>$@
else