We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新版 C++ 特性
“可变参数模板的应用”一节中
template <typename T> ostream& operator<<(ostream& os, vector<T> V) { os << "[ "; for (auto vv : V) os << vv << ", "; os << "]"; return os; }
此处的 vector<T> V 改为 const vector<T>& V,auto vv 改为 const auto& vv 较好,可避免不必要的拷贝。
vector<T> V
const vector<T>& V
auto vv
const auto& vv
修改后的代码如下所示。
template <typename T> ostream& operator<<(ostream& os, const vector<T>& V) { os << "[ "; for (const auto& vv : V) os << vv << ", "; os << "]"; return os; }
The text was updated successfully, but these errors were encountered:
感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
我正在访问这个页面(最好带链接)
新版 C++ 特性
我发现页面有这样的问题
“可变参数模板的应用”一节中
此处的
vector<T> V
改为const vector<T>& V
,auto vv
改为const auto& vv
较好,可避免不必要的拷贝。修改后的代码如下所示。
The text was updated successfully, but these errors were encountered: