Re: gtkmm and C++0x
- From: michi7x7 <mailing-lists michi7x7 de>
- To: gtkmm-list gnome org
- Subject: Re: gtkmm and C++0x
- Date: Wed, 31 Mar 2010 12:51:39 +0200
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.
] [Thread Prev