Home » Community » Coffee corner » C++11
Re: C++11 [message #36671 is a reply to message #36664] |
Sun, 24 June 2012 16:24   |
|
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 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 
Honza
|
|
|
 |
|
C++11
|
 |
|
Re: C++11
By: mirek on Fri, 14 October 2011 12:18
|
 |
|
Re: C++11
By: lectus on Sat, 03 December 2011 12:03
|
 |
|
Re: C++11
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 15:08
|
 |
|
Re: C++11
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 18:05
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 18:47
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 19:30
|
 |
|
Re: C++11
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 21:00
|
 |
|
Re: C++11
By: mirek on Mon, 03 December 2012 11:04
|
 |
|
Re: C++11
By: mirek on Mon, 03 December 2012 11:10
|
 |
|
Re: C++11
By: Lance on Tue, 04 December 2012 00:55
|
 |
|
Re: C++11
By: mirek on Tue, 04 December 2012 08:08
|
 |
|
Re: C++11
By: Lance on Tue, 19 March 2013 03:24
|
 |
|
Re: C++11
|
 |
|
Re: C++11
By: mirek on Sun, 24 June 2012 12:50
|
 |
|
Re: C++11
By: unodgs on Sun, 24 June 2012 13:02
|
 |
|
Re: C++11
By: mirek on Sun, 24 June 2012 13:13
|
 |
|
Re: C++11
By: unodgs on Sun, 24 June 2012 13:21
|
 |
|
Re: C++11
|
 |
|
Re: C++11
By: lectus on Wed, 27 June 2012 01:29
|
 |
|
Re: C++11
By: mirek on Thu, 28 June 2012 08:16
|
 |
|
Re: C++11
By: Lance on Sun, 02 December 2012 06:18
|
Goto Forum:
Current Time: Tue Apr 29 16:11:34 CEST 2025
Total time taken to generate the page: 0.00960 seconds
|