我已阅读this question,但看起来有些不同。以下语句是否复制矢量:
bool MyClass::myMethod(const std::vector<Point> *data_) {
// For some reason, I don't want to work with pointer,
// but I'm afraid the following statement copies the data unnecessarily
const std::vector<Point>& data = *data_;
}
我知道,这可能不是最聪明的问题!