Re: gtkmm and C++0x

I had a discussion about this with Daniel once. One of the good uses
of auto would be avoid redundancy.
eg., Glib::RefPtr<Gtk::IconTheme>  icon_theme = Gk::IconTheme::get_default();
Here the return type is quite obvious and using auto makes sense to
make the code more readable by avoiding really long statements.

But your IDE can't definitely know the type of this variable.
Even worse: if the gtkmm-Team decides to return Gtk::IconTheme* instead, your "auto"-Type would be Gtk::IconTheme. Glib::RefPtr could have a constructor, which takes a Glib::Object, so "normal" code would work, but code using "auto" not.

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