]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/std-vector.hh
* .cvsignore: Add out*, out-www, config-*. Remove lots of cruft.
[lilypond.git] / flower / include / std-vector.hh
index e8367ae8a625e7068b5b70c1fe6beac96cd06c4f..7fef97abfb2681116c0a2c02f1da7b05f84f417d 100644 (file)
@@ -41,7 +41,6 @@ int default_compare (T *const &a, T *const &b)
 
 #if !STD_VECTOR
 /* Also declare vector, in the wrong way.  */
-#include <algorithm>
 #include <iostream>
 #include <sstream>
 #endif
@@ -50,7 +49,45 @@ int default_compare (T *const &a, T *const &b)
 
 #if STD_VECTOR
 
+#include "config.hh"
+
+#if HAVE_STL_DATA_METHOD
+#include <vector>
+#else /* !HAVE_STL_DATA_METHOD */
+#define vector __vector
 #include <vector>
+#undef vector
+namespace std {
+  /* Interface without pointer arithmetic (iterator) semantics.  */
+  template<typename T>
+  class vector : public __vector<T>
+  {
+  public:
+    typedef typename __vector<T>::iterator iterator;
+    typedef typename __vector<T>::const_iterator const_iterator;
+    
+    vector<T> () : __vector<T> ()
+    {
+    }
+    
+    vector<T> (const_iterator b, const_iterator e) : __vector<T> (b, e)
+    {
+    }
+    
+    T*
+    data ()
+    {
+      return &(*this)[0];
+    }
+    
+    T const*
+    data () const
+    {
+      return &(*this)[0];
+    }
+  };
+}
+#endif /* !HAVE_STL_DATA_METHOD */
 
 namespace std {