Re: gtkmm and C++0x
- From: Dodji Seketeli <dodji seketeli org>
- To: Oscar Lazzarino <oscar lazzarino gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: gtkmm and C++0x
- Date: Wed, 31 Mar 2010 15:50:59 +0200
Le mer. 31 mars 2010 à 12:02:50 (+0200), Oscar Lazzarino a écrit:
> It seems to me that "auto" is the sort of feature that
> should be implemented in an IDE, just to make you type faster.
I think it's not only that. It can be useful to declare objects
for which it's hard to know the type without having a deep knowledge of
the library you are using. E.g:
auto foo = boost::bind(&weirdo_function, _2, _1, weirdo_object);
The type of foo is the type of the particular function template version
of boost::bind that matches the arguments above. If the argument are
template instantiations themselves, you can have some headache
determining the type of foo. I would believe the auto type specifier
can greatly help there. Incidentally, the new decltype operator can help
in similar situations to infer the type of expressions.
I wouldn't be so quick in asserting that those are
"just to make you type faster".
Dodji
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]