]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/std-vector.hh
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / flower / include / std-vector.hh
index 8c31e664aa23f26835db10f6d69b1e6b5d8db40c..83e58d299ccbc180babe5a7f2aa34f2b1a5dbca7 100644 (file)
@@ -24,7 +24,7 @@ int default_compare (T const &a, T const &b)
 {
   if (a < b)
     return -1;
-  else if (a > b)
+  else if (b < a)
     return 1;
   else
     return 0;
@@ -42,7 +42,6 @@ int default_compare (T *const &a, T *const &b)
 }
 
 #include "compare.hh"
-#include "config.hh"
 
 #ifndef VSIZE
 #define VSIZE
@@ -66,21 +65,25 @@ namespace std {
   public:
     typedef typename __vector<T>::iterator iterator;
     typedef typename __vector<T>::const_iterator const_iterator;
-    
+
     vector<T, A> () : __vector<T, A> ()
     {
     }
-    
+
+    vector<T, A> (vector<T, A> const& v) : __vector<T, A> (v)
+    {
+    }
+
     vector<T, A> (const_iterator b, const_iterator e) : __vector<T, A> (b, e)
     {
     }
-    
+
     T*
     data ()
     {
       return &(*this)[0];
     }
-    
+
     T const*
     data () const
     {
@@ -128,7 +131,7 @@ concat (vector<T> &v, vector<T> const& w)
 {
   v.insert (v.end (), w.begin (), w.end ());
 }
-  
+
 template<class T>
 void
 binary_search_bounds (vector<T> const &table,
@@ -269,7 +272,7 @@ vector_sort (vector<T> &v, int (*compare) (T const &, T const &),
   vector_sort (v, compare, last + 1, upper);
 }
 #endif
-  
+
 template<typename T>
 void
 reverse (vector<T> &v)
@@ -324,4 +327,8 @@ junk_pointers (vector<T> &v)
 }
 #endif /* HAVE_BOOST_LAMBDA */
 
+vector<string> string_split (string str, char c);
+
+#define iterof(i,s) typeof((s).begin()) i((s).begin())
+
 #endif /* STD_VECTOR_HH */