Re: [gtkmm] Glib critical messages on Property<>



On Fre, 2003-03-28 at 12:51, Frank Naumann wrote:
> Hello!
> 
> > > Yes, problem caused by Glib::Value<T*> (GValue, actualy).
> > >
> > > 1. T* should be a pointer to class derived from GLib::Object.
> >
> > No, it doesn't need to.
> 
> I just tested a little bit. If the class is derived from GLib::Object it
> work fine. I also looked into the source code: Glib::Value<void*> is
> much simpler and straightforward; Glib::Value<T*> depend on
> ValueBase_Object (is this the reason why T must be derived from
> GLib::Object?).

If you have a closer look at Glib::Value_Pointer<>, you'll see that it
uses a tricky overloading technique to dispatch between pointer types
derived from Glib::Object and non-Glib::Object pointer types at compile
time.

> So I wrote my own template specialization like for Glib::Value<void*> and
> this work fine too.

Uhm, please don't do that.  Adding specializations of types in the Glib
namespaces means touching library internals.

> It's just the question if it's really wanted that for
> Glib::Value<T*> T must derive from GLib::Object (for me it's not logical).

No it isn't.  I suspect it's a problem with the way Glib::Property<>
uses Glib::Value<>.  As I said I'll investigate the problem later today.

Regards,
--Daniel





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