Re: C++11 features, move semantics?
- From: Murray Cumming <murrayc murrayc com>
- To: François Legendre <F Legendre u-pec fr>
- Cc: Christof Meerwald <cmeerw cmeerw org>, gtkmm-list gnome org
- Subject: Re: C++11 features, move semantics?
- Date: Wed, 21 Jan 2015 11:42:23 +0100
On Wed, 2015-01-21 at 11:36 +0100, François Legendre wrote:
Hi,
For range based loop, why not use the name of the element (and not the indice) ?
- for(unsigned i = 0; i < names.size(); i++)
- std::cout << names[i] << "." << std::endl;
+ for(const auto& i : names)
+ std::cout << i << "." << std::endl;
+ for(const auto& name : names)
+ std::cout << name << "." << std::endl;
Yes, of course. I might have done that via a regex or put my own brain
on automatic. Patches are welcome.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]