
4 Oct
2004
4 Oct
'04
7 a.m.
Hi Jurko,
Maybe, we can just decide that all reasonable compilers support NRVO, and stop worring about returning vectors/list by value?
Hmmm... I do not think VC7.1 supports NRVO (it does support unnamed RVO though). Do you consider it a 'reasonable compiler'?
Apparently, I'd have to decide it's not 100% reasonable ;-)
Or should we say that it does not matter if that compiler generated slower code?
Probably. The interface which returns vector<> is nicer, and we should not kill a good interface because of a specific compiler. Besides, in this case, both vector<> returning function and an iterator interface are reasonable, so if you're on VC7.1 and care about globbing performance, you can use the iterators interface. - Volodya