Re: Replace Gtk::manage() with std::unique_ptr<>?



On Mon, 2016-02-08 at 11:56 +0000, Jonathan Wakely wrote:
[snip]
A cleaner API would operate in terms of rvalues returned from
functions, and passed straight into other functions, avoiding
std::move entirely.
[snip]

Do you mean like this?

  window.add(create_button("something"));

That's already possible by just taking a std::unique_ptr<> by value.

However, I wouldn't want to enforce that if it forced people to write
code like this, without being able to break it up into separate lines:

  window.add(
    create_frame_with_children(
      create_label("something"),
      create_button("some button")));

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com





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