2015-01-28 14:00 GMT+01:00 Russel Winder <[email protected]>: > 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; >> > > What about using: > > for (auto&& name: names) > > ? We want a const traversal ; it is less secure to code "auto&&". --- François
> > -- > Russel. > ============================================================================= > Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected] > 41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected] > London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder _______________________________________________ gtkmm-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/gtkmm-list
