Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » C++11
Re: C++11 [message #36671 is a reply to message #36664] Sun, 24 June 2012 16:24 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Sun, 24 June 2012 13:13

GUI_APP_MAIN
{
	Vector<int> v;
	v << 1 << 2 << 3;
	for(int& x: v)
		LOG(x);
}


Or even with auto:
GUI_APP_MAIN
{
	Vector<int> v;
	v << 1 << 2 << 3;
	for(auto& x: v)
		LOG(x);
}


I agree that the intializer list syntax provides the same functionality as already existing code. The performance gain is not important because initialization shouldn't happen much in performance oriented code (where one should generaly reuse existing containers as much as possible). OTOH it is easy to read and I think the simplicity of it fits nice into U++. Also, the sooner people start encountering c++11 code in real world examples, the sooner it gets widely adopted, so maybe we could give a good example to the world Wink It can't hurt, even if it stays semi-hidden under flag USECXX11 (or similar) for a first few years. This is just my opinion, and I don't force it to anyone... but I will probably starte experiment in this direction soon, and I will most probably try to show here what I can come up with Wink

Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: live session Prague 8.3.2013
Next Topic: Have Visual Studio? Looking for prebuilt SDL 2.0
Goto Forum:
  


Current Time: Mon Apr 29 16:46:41 CEST 2024

Total time taken to generate the page: 0.03016 seconds