一个初始化列表对象。编译器将自动从初始化列表声明符构造此类对象。
成员类型value_type是容器中元素的类型,在 set 中定义为其第一个模板形参(T)的别名。
☉ 返回值
*this
☣ 示例
// assignment operator with sets
#include <iostream>
#include <set>
int main ()
{
int myints[]={ 12,82,37,64,15 };
std::set<int> first (myints,myints+5); // set with 5 ints
std::set<int> second; // empty set
second = first; // now second contains the 5 ints
first = std::set<int>(); // and first is empty
std::cout << "Size of first: " << int (first.size()) << '\n';
std::cout << "Size of second: " << int (second.size()) << '\n';
return 0;
}