Re: gtkmm and C++0x
- From: Debarshi Ray <debarshi ray gmail com>
- To: Alexander Shaduri <ashaduri gmail com>
- Cc: Chris Vine <chris cvine freeserve co uk>, Murray Cumming <murrayc openismus com>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: gtkmm and C++0x
- Date: Wed, 31 Mar 2010 13:05:25 +0300
> Please keep in mind that explicit mentioning of the actual variable types
> in documentation / examples actually helped me with my learning process.
> Substituting the types with auto may diminish the educational value of
> the documentation.
Agreed.
> For example,
> Gtk::Widget* w = somefunc();
> is somewhat self-documenting in a way that we know that somefunc() returns
> Gtk::Widget* (or similar).
Right.
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.
Cheers,
Debarshi
--
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]