Re: get/set wrap methods.
- From: Daniel Boles <dboles src gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: get/set wrap methods.
- Date: Fri, 23 Feb 2018 14:42:37 +0000
>
Basically, this is glibmm limitation for now.
I can see no way that this is any fault or limitation of glibmm's. It is rather a simple fact of any language supporting reference semantics: You can't (safely, usefully) have a reference of a given type unless you have an instance of that type, with at least the same lifetime as that of the reference.
You have a char* but want to return a Glib::ustring&; these are not compatible facts. So, the Glib::ustring must be created whenever requested, and returned by value. If you want to return a Glib::ustring&, keep a Glib::ustring somewhere, and use a reference to that.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]