Re: [glade--]Re: [gtkmm] Problem with gtkmm handling comboboxes from glade



Am Mon, 2001-12-03 um 15.04 schrieb Murray Cumming:
> On Mon, 2001-12-03 at 14:46, Daniel Elstner wrote:
> > Well, we could add specializations of Traits<T> for 'const T[N]' and
> > 'const T*'.  That might help the compiler to chose the correct
> > specialization, and it won't break the API or ABI at all.
> 
> OK. Please try.

Can anyone who is using RedHat's GCC 2.96 please try out the attached
patch (to gtkmm-1.2.8), and tell us wether it fixes the problem?

Thanks,
--Daniel

? gtkmm-1.2_sarray.diff
? docs/gdk/header
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk--/ChangeLog,v
retrieving revision 1.68
diff -u -3 -r1.68 ChangeLog
--- ChangeLog	2001/11/03 19:32:40	1.68
+++ ChangeLog	2001/12/03 20:00:52
@@ -1,3 +1,8 @@
+Release: Gtk-- 1.2.9
+  * SArray_Helpers::Traits<T>:  Added specializations for 'const T*',
+    'T *const', 'const T *const' and 'const T[N]', so that the inofficial
+    RedHat GCC 2.96 chooses the correct one.  (Daniel Elstner)
+
 Release: Gtk-- 1.2.8
   * CList_Helpers::Row::Row() implemented, not just declared.
     (Murray Cumming)
Index: src/gtk--/base.h
===================================================================
RCS file: /cvs/gnome/gtk--/src/gtk--/base.h,v
retrieving revision 1.19
diff -u -3 -r1.19 base.h
--- src/gtk--/base.h	2000/11/15 02:23:11	1.19
+++ src/gtk--/base.h	2001/12/03 20:00:56
@@ -655,8 +655,20 @@
     { return const_cast<const char* const*>(t); }
   static size_t get_size(const T* t) { return count_strings(t); }
 };
- 
-// This specialization is for built in arrays of (const) char*, note that
+
+template <class T>
+struct Traits<T *const> : Traits<T*>
+{};
+
+template <class T>
+struct Traits<const T*> : Traits<T*>
+{};
+
+template <class T>
+struct Traits<const T *const> : Traits<T*>
+{};
+
+ // This specialization is for built in arrays of (const) char*, note that
 // the arrays must still be zero-terminated, even though the size is known
 // at compile time.
 template <class T, size_t N>
@@ -664,6 +676,10 @@
 {
   static size_t get_size(const T*) { return N - 1; }
 };
+
+template <class T, size_t N>
+struct Traits<const T[N]> : Traits<T[N]>
+{};
 #endif
 
 // (internal) This is equivalent to a const char**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]