Hi all,
Just testing how far this echo comes..
Bo
Sleep well; OS/2's still awake! ;)
Just testing how far this echo comes..
Just testing how far this echo comes..
Just testing how far this echo comes..
Just testing how far this echo comes..
This one too.. :)
On Tue 2009-04-28 03:57, Bo Simonsen (1:261/38) wrote to All:
Just testing how far this echo comes..
Hello!
Just thought of, are you guys also excited to see the final
version of the C++0x standard?
So far, I've experimented some, especially with the auto-keyword.
(It's in GCC 4.4)
Instead of writing:
std::set<int> cont;
cont.insert(5);
cont.insert(7);
for(typename std::set<int>::iterator it = cont.begin();
it != cont.end();
++it) {
// do something with *it
}
We can simply write:
for(auto it=cont.begin(); it != cont.end(); ++it) {
}
for(typename std::set<int>::iterator it = cont.begin();
it != cont.end();
++it) {
// do something with *it
}
How does "typename" work here? I'm not familiar with recent C++ ac>developments...
We can simply write:
for(auto it=cont.begin(); it != cont.end(); ++it) {
}
Hmm. I don't really know how that works, but I think I prefer this:
typedef std::set<int> intset_t;
intset_t cont;
cont.insert(5);
cont.insert(7);
intset_t::iterator it = cont.begin();
while (it != cont.end())
{
// do something with *it
++it;
}
Having said that, my personal preference is a bit academic - as these ac>days I spend most of my programming time writing code in Python :-)
cont = set()
cont.add(5)
cont.add(7)
for it in cont:
print it
Bo Simonsen wrote to All <=-
Hi all,
Just testing how far this echo comes..
Bo
Sysop: | Nelgin |
---|---|
Location: | Plano, TX |
Users: | 506 |
Nodes: | 10 (1 / 9) |
Uptime: | 09:15:58 |
Calls: | 8,125 |
Calls today: | 5 |
Files: | 15,396 |
Messages: | 907,119 |
Posted today: | 13 |