]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorjanneke <janneke>
Tue, 14 Feb 2006 23:50:16 +0000 (23:50 +0000)
committerjanneke <janneke>
Tue, 14 Feb 2006 23:50:16 +0000 (23:50 +0000)
ChangeLog
flower/include/flower-proto.hh
flower/include/std-vector.hh
flower/test-std.cc
stepmake/aclocal.m4

index 869058f0be6e2409b1290cb37822d47d26876114..c46afb8051249dcb18000de1779261911159cbd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-02-15  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * flower/include/std-vector.hh: Better wrapper compatibility with
+       std::vector.
+
+       * flower/include/flower-proto.hh: Remove cheap forward declaration
+       attempts.
+
+       * stepmake/aclocal.m4 (STEPMAKE_STL_DATA_METHOD): Bugfix.
+
 2006-02-14  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/invoking.itely: add warning about command line.
index 91e2e36aae59a7969636a8df3b16b5f28ebd2e38..1e14a5b10c5dbf3f3860d969ff62e1d567ae6497 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
   fflower-proto.hh -- typenames in flowerlib
 
@@ -17,15 +16,8 @@ template<class K, class V> struct Hash_table_iter;
 typedef unsigned char Byte;
 struct String_convert;
 
-#if 0
-namespace std {
-struct string;
-template<typename T> struct vector;
-}
-#else
 #include "std-string.hh"
 #include "std-vector.hh"
-#endif
 using namespace std;
 
 #include "real.hh"
index bb60308d5d7c41a539f5764450e24a7c6802ab59..8c31e664aa23f26835db10f6d69b1e6b5d8db40c 100644 (file)
@@ -60,18 +60,18 @@ typedef size_t vsize;
 namespace std {
 
   /* Interface without pointer arithmetic (iterator) semantics.  */
-  template<typename T>
-  class vector : public __vector<T>
+  template<typename T, typename A=std::allocator<T> >
+  class vector : public __vector<T, A>
   {
   public:
     typedef typename __vector<T>::iterator iterator;
     typedef typename __vector<T>::const_iterator const_iterator;
     
-    vector<T> () : __vector<T> ()
+    vector<T, A> () : __vector<T, A> ()
     {
     }
     
-    vector<T> (const_iterator b, const_iterator e) : __vector<T> (b, e)
+    vector<T, A> (const_iterator b, const_iterator e) : __vector<T, A> (b, e)
     {
     }
     
@@ -88,32 +88,6 @@ namespace std {
     }
   };
 
-  /* FIXME: it appears that choosing this function is broken when stl
-     has no data () member too...  */
-  template<typename T>
-  void
-  binary_search_bounds (vector<T*> const &table,
-                       T const *key, int (*compare) (T *const &, T *const &),
-                       vsize *lo,
-                       vsize *hi)
-  {
-    vsize cmp;
-    int result;
-
-    /* binary search */
-    do
-      {
-       cmp = (*lo + *hi) / 2;
-
-       result = (*compare) ((T *) key, table[cmp]);
-
-       if (result < 0)
-         *hi = cmp;
-       else
-         *lo = cmp;
-      }
-    while (*hi - *lo > 1);
-  }
 } /* namespace std */
 
 #endif /* !HAVE_STL_DATA_METHOD */
@@ -183,6 +157,31 @@ binary_search_bounds (vector<T> const &table,
   while (*hi - *lo > 1);
 }
 
+template<typename T>
+void
+binary_search_bounds (vector<T*> const &table,
+                     T const *key, int (*compare) (T *const &, T *const &),
+                     vsize *lo,
+                     vsize *hi)
+{
+  vsize cmp;
+  int result;
+
+  /* binary search */
+  do
+    {
+      cmp = (*lo + *hi) / 2;
+
+      result = (*compare) ((T *) key, table[cmp]);
+
+      if (result < 0)
+       *hi = cmp;
+      else
+       *lo = cmp;
+    }
+  while (*hi - *lo > 1);
+}
+
 #if 0
 /* FIXME: what if COMPARE is named: int operator == (T const&, T const&),
    wouldn't that work for most uses of BINARY_SEARCH?
index c2214418a594525ad59afbff1c90da8c1cff8e94..4724f8f5ca7431247f05c0c9189a1e650e1dfd9d 100644 (file)
@@ -1,8 +1,9 @@
-
+#define STD_VECTOR 1
 
 #if !STD_VECTOR
 #define Array flower_vector
 #endif
+
 #define HAVE_BOOST_LAMBDA 1
 #include "std-vector.hh"
 
index 8ec3c5954d58a06962d880188ab9005fcf700818..b51d087712eb3eb0b43e483094293863c495c0fd 100644 (file)
@@ -1046,7 +1046,7 @@ AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [
 #include <vector>
 using namespace std;
 vector <int> v;
-(void) v.data ();
+void *p = v.data ();
 ]])],
            [stepmake_stl_data_method=yes],
            [stepmake_stl_data_method=no]))