关于语义和性能的几个问题:
x = 0;
While (x < 10) {
std::cout << "Some text here to send to cout";
++x;
}
我使用 gcc 4.7,要流式传输的文本是否应该包含在 std::move 中?
像这样:
x = 0;
While (x < 10) {
std::cout << std::move("Some text here to send to cout");
++x;
}
虽然我在问,在这种情况下是否更好地将字符串设为静态,例如:
x = 0;
While (x < 10) {
static const char* s = "Some text here to send to cout";
std::cout << s;
++x;
}