幾個問題的問題:使用gcc 4.7,如果該文本流包裹的std ::內部移動C++右值移動語義,大約流約語義和性能
x = 0;
While (x < 10) {
std::cout << "Some text here to send to cout";
++x;
}
林?
像這樣:
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;
}
無論如何,所有傳入的都是一個指針。 – chris
你爲什麼期望這個舉動能夠提供幫助? –