Re: [gtkmm] get a reference from a Gtk::TreeValueProxy
- From: "erwan ancel" <erwan ancel free fr>
- To: "Daniel Elstner" <daniel elstner gmx net>
- Cc: "gtkmm-list" <gtkmm-list gnome org>
- Subject: Re: [gtkmm] get a reference from a Gtk::TreeValueProxy
- Date: Wed, 5 Feb 2003 08:36:40 +0100
This is what I did finaly: I used a smart pointer.
And that works fine.
Erwan
----- Original Message -----
From: "Daniel Elstner" <daniel elstner gmx net>
To: "erwan ancel" <erwan ancel free fr>
Cc: "gtkmm-list" <gtkmm-list gnome org>
Sent: Wednesday, February 05, 2003 3:25 AM
Subject: Re: [gtkmm] get a reference from a Gtk::TreeValueProxy
> On Fre, 2003-01-31 at 10:55, erwan ancel wrote:
> > > So it would be best to store the pointer. If you are worried about the
> > > efficiency of copying by value then you shouldn't encourage the
TreeView
> > > to do it internally either.
>
> The best is to use a smart pointer, there are plenty of them around.
>
> [...]
>
> > > You might like to patch TreeValueProxy in gtkmm 2.4 to allow
> > > get-a-pointer-or-reference-to-the-value.
>
> No way. Due to the necessary translation from the C interface to C++,
> temporaries have to be created and returned by value. This is a
> documented Glib::Value<> restriction. (Granted, the TreeModelColumn<>
> documentation doesn't mention that it's implemented via Glib::Value<>.)
>
> And are you sure your problem is really operator=() ? This would be
> quite unusual since most types implement both copy construction and copy
> assignment if they're copyable at all.
>
> All STL containers require a copy constructor. Copy assignment is not
> needed by all operations, but generally advisable. Gtk::TreeModel has
> the same policy with the only restriction that copy assignment is always
> required.
>
> So, is your type actually usable with STL containers?
>
> --Daniel
>
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]