Sea*_*ean 5 c++ templates stl generic-programming c++11
我从一本书上读了一段代码,但我不太了解语法,
const auto& [local_min, local_max] = minmax(A[i], A[i+1]);
Run Code Online (Sandbox Code Playgroud)
这里A是vector中int和local_min和local_max的int。
我知道minmax返回 a pair,但是方括号有什么作用,即 [local_min, local_max]?我想它不适用于这里的数组。
谢谢。
| 归档时间: |
|
| 查看次数: |
4015 次 |
| 最近记录: |