0

虽然我意识到 Visual C++ 是一种缺乏我们大多数新程序员现在习惯的语法糖的语言,但 VC++ 2005 必须有一些快捷方式,至少可以减少代码的冗长性;有谁知道这些,还是c ++就是那么冗长?

4

1 回答 1

1

VC++ offers a couple of extensions that are not part of C++ standard, the only one that comes to my mind right now is "for each" but I can't see why somebody would use it since boost offers a portable implementation.

std::vector<int> vec;
for each(int i in vec)
{
    // do something with i
}

The only other advice is to use standard library and boost as much as possible and not reinvent the things somebody else had already implemented (probably much better than you could).

于 2009-12-02T22:23:48.570 回答