假设我有这些功能
std::Vector<Point> calculate() {
std::Vector<Point> points; //do stuff with points
return points;
}
和
void calculate(std::Vector<Point>& points) {
//do stuff with points
}
所以我的问题是特定于在堆栈上初始化的对象,并且是 stl 对象。性能上有什么区别,流行的方法是什么
问候