|
From: Andy D. <dou...@la...> - 2003-02-14 20:42:50
|
On Fri, 14 Feb 2003, Jonathan Brandmeyer wrote:
> The option to inherit Py::SeqBase::iterator from
> std::random_access_iterator<> has been removed, now it inherits from
> std::iterator<>. STANDARD_LIBRARY_ITERATOR_TRAITS is no longer needed, and
> has been removed. This should comply with the standard, and has been tested
> with g++ 3.2.1
I was afraid that's what you meant :-(. I don't think it will work with
somewhat older systems. For example, in both Debian 3.0 ("woody") and
RedHat 7.0 systems the 'std::iterator<>' stuff in
/usr/include/g++-3/iterator.h is surrounded by
#if 0
using __STD::iterator;
#endif
I think a better "fix" would be to leave the comment and #define in
CXX_Config.h, but change the default value of the
STANDARD_LIBRARY_ITERATOR_TRAITS #define to match the current standard.
Specifically, I had in mind something like this:
diff -r -u VPython/cvisual/CXX/Include/CXX_Config.h VPython-andy/cvisual/CXX/Include/CXX_Config.h
--- VPython/cvisual/CXX/Include/CXX_Config.h Mon Jul 22 16:03:01 2002
+++ VPython-andy/cvisual/CXX/Include/CXX_Config.h Thu Feb 13 15:52:02 2003
@@ -2,7 +2,7 @@
#define __py_config_hh__
// Macros to deal with deficiencies in compilers
#define COMPILER_SUPPORTS_NAMESPACES 1
-#define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1
+#define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0
#ifdef MS_WIN32
#undef STANDARD_LIBRARY_HAS_ITERATOR_TRAITS
diff -r -u VPython/cvisual/CXX/README.htm VPython-andy/cvisual/CXX/README.htm
--- VPython/cvisual/CXX/README.htm Mon Jul 22 16:03:01 2002
+++ VPython-andy/cvisual/CXX/README.htm Fri Feb 14 15:41:30 2003
@@ -13,6 +13,19 @@
set the environment variables LINKCC to 'g++' and LDSHARED to 'g++ -shared'
or whatever is appropriate for your C++ compiler.
<h2>
+std iterator problems</h2>
+<p>
+Cvisual uses std::iterator from the standard library.
+If you encounter error messages such as
+<pre>no class template named `iterator' in `std'</pre>
+then edit Include/CXX_Config.h and change
+<pre>#define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0</pre> to
+<pre>#define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1</pre>.
+This will cause cvisual to use random_access_iterator instead.
+This was present in early draft C++ standards, and is implemented in
+the C++ libraries in a number of Linux distributions, including RedHat
+7.0 and Debian 3.0.
+<h2>
Version 4 (February, 2000)</h2>
CXX compiles with gcc - 2.95. Includes new version of extension portion
by Barry Scott. I have personally only tested this on RH Linux 6.
--
Andy Dougherty dou...@la...
Dept. of Physics
Lafayette College, Easton PA 18042
|