Re: C++11 features, move semantics?



On 31/07/15 03:16 AM, Murray Cumming wrote:
Does anyone see any need for this in gtkmm?

In theory, I guess we could make Gtk::Widget movable but not copyable,
so we could do things like this sometimes:

Gtk::Widget widget = generate_some_widget();

But I think that would be very confusing.

What's already confusing and hard to fix without breaking everything is
the fact that we can stack allocate a Gtk::Widget while everything else
is Glib::RefPtr<>.

I believe making Gtk::Widget movable (but not copyable) has a benefit
and could be implemented without too much confusion if we are able to
deal with "moved" Gtk::Widget properly - ie let the programmer know of
the error (like when attenmpting to perform something with a Gtk::Widget
no longer valid since we move it).

Just a few thoughts.

Hub


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