具体的示例如下:
std::vectorint> nums1 {3, 1, 4, 6, 5, 9};
std::vectorint> nums2;
std::vectorint> nums3;...::vectorint> data = {1, 2, 3};
std::coutstd::endl; //2
data.at(1)=8; //此时data={1, 8,...前
constexpr void swap( vector& other ) noexcept(); //C++20 起
其用法示例如下图所示:
std::vectorint> a1{1, 2,...其具体的应用示例如下所示:
std::vectorint> alice{1, 2, 3};
std::vectorint> bob{7, 8, 9, 10};
std::vectorint> eve...(it, c.end());
return r;
示例:
std::vectorint> c{1, 2, 3, 4, 6};
// 擦除c中的值等于3的元素
auto erased1 = std::