On Sunday 15 of July 2007 02:29:05 Jakub Bogusz wrote:
> Zdaje się, że problem jest też z gtkmm/glibmm (pomijając już inne
> problemy w ardour, ale te się da zwalczyć bez ruszania bibliotek) - nie
> da się skompilować takiego kodu:
>
> #include <glibmm.h>
> #include <gtkmm.h>
> #include <vector>
>
> Gtk::SelectionData d;
> Glib::StringArrayHandle s = d.get_uris();
> std::vector<Glib::ustring> u = s;
>
> (iterator dla StringArrayHandle nie ma operatorów + i --, w najnowszej
> wersji glibmm też)

tak dokladnie, to ArrayHandle< T > nie ma symetrycznego operatora +.
ma dla IT + difference_type, ale nie ma juz dla difference_type + IT.
natomiast operatora -- nie ma w ogole. zreszta to tylko czubek gory
lodowej, potem wyplywa, ze IT nie ma domyslnego konstruktora, a dalej
juz mi sie nie chce sprawdzac [zalaczam odreczna poprawke]. jak chcecie,
to mozecie wylaczyc w th sprawdzanie konceptow, ale tylko zamaskujecie
tym bledy, tak samo jak ardour-c++.patch, ktory zmienil porownywanie
obiektow w porownanie adresow obiektow, co w prostej linii niszczy
determinizm przeplywu sterowania w aplikacji.

-- 
MIT is like the Paris Hilton of technology universities.
   Every guy knows about it and wants to get inside.
--- glibmm-2.12.10/glib/glibmm/arrayhandle.h.orig	2007-06-10 10:36:11.000000000 -0400
+++ glibmm-2.12.10/glib/glibmm/arrayhandle.h	2007-07-17 18:11:41.000000000 -0400
@@ -148,13 +148,15 @@
   typedef value_type                        reference;
   typedef void                              pointer;
 
-  explicit inline ArrayHandleIterator(const CType* pos);
+  explicit inline ArrayHandleIterator(const CType* pos = 0);
 
   inline value_type operator*() const;
   inline value_type operator[](difference_type offset) const;
 
   inline ArrayHandleIterator<Tr> &     operator++();
   inline const ArrayHandleIterator<Tr> operator++(int);
+  inline ArrayHandleIterator<Tr> &     operator--();
+  inline const ArrayHandleIterator<Tr> operator--(int);
 
   // All this random access stuff is only there because STL algorithms
   // usually have optimized specializations for random access iterators,
@@ -163,7 +165,12 @@
   inline ArrayHandleIterator<Tr> &     operator+=(difference_type rhs);
   inline ArrayHandleIterator<Tr> &     operator-=(difference_type rhs);
   inline const ArrayHandleIterator<Tr> operator+ (difference_type rhs) const;
+  template <class U>
+  friend inline const ArrayHandleIterator<U> operator+(typename ArrayHandleIterator<U>::difference_type, ArrayHandleIterator<U> const&);
   inline const ArrayHandleIterator<Tr> operator- (difference_type rhs) const;
+  template <class U>
+  friend inline const ArrayHandleIterator<U> operator-(typename ArrayHandleIterator<U>::difference_type, ArrayHandleIterator<U> const&);
+  
   inline difference_type operator-(const ArrayHandleIterator<Tr>& rhs) const;
 
   inline bool operator==(const ArrayHandleIterator<Tr>& rhs) const;
@@ -287,6 +294,19 @@
 }
 
 template <class Tr> inline
+ArrayHandleIterator<Tr>& ArrayHandleIterator<Tr>::operator--()
+{
+  --pos_;
+  return *this;
+}
+
+template <class Tr> inline
+const ArrayHandleIterator<Tr> ArrayHandleIterator<Tr>::operator--(int)
+{
+   return ArrayHandleIterator<Tr>(pos_--);
+}
+
+template <class Tr> inline
 ArrayHandleIterator<Tr>&
 ArrayHandleIterator<Tr>::operator+=(typename ArrayHandleIterator<Tr>::difference_type rhs)
 {
@@ -309,6 +329,12 @@
   return ArrayHandleIterator<Tr>(pos_ + rhs);
 }
 
+template <class U> inline
+const ArrayHandleIterator<U> operator+(typename ArrayHandleIterator<U>::difference_type lhs, ArrayHandleIterator<U> const& rhs)
+{
+  return ArrayHandleIterator<U>(lhs + rhs.pos_);
+}
+
 template <class Tr> inline
 const ArrayHandleIterator<Tr>
 ArrayHandleIterator<Tr>::operator-(typename ArrayHandleIterator<Tr>::difference_type rhs) const
@@ -316,6 +342,12 @@
   return ArrayHandleIterator<Tr>(pos_ - rhs);
 }
 
+template <class U> inline
+const ArrayHandleIterator<U> operator-(typename ArrayHandleIterator<U>::difference_type lhs, ArrayHandleIterator<U> const& rhs)
+{
+  return ArrayHandleIterator<U>(lhs - rhs.pos_);
+}
+
 template <class Tr> inline
 typename ArrayHandleIterator<Tr>::difference_type
 ArrayHandleIterator<Tr>::operator-(const ArrayHandleIterator<Tr>& rhs) const
_______________________________________________
pld-devel-pl mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl

Odpowiedź listem elektroniczym