set<int> first{1,2,3};
int myints[]= {10,20,30,40,50};
set<int> second (myints,myints+5); // range
set<int> third (second); // a copy of second
set<int> fourth (second.begin(), second.end()); // iterator
find() Searches the container for an element equivalent to val and returns an iterator to it if found, otherwise it returns an iterator to set::end.
iterator find (const value_type& val);
set
集合,去除重複的元素,資料由小到大排序。
#include <set>
創建
Iterators
begin()
end()
回傳一個 iterator,它指向 vector 最尾端元素的下一個位置(請注意:它不是最末元素)rbegin()
rend()
cbegin()
cend()
crbegin()
crend()
Capacity
empty()
size()
max_size
Capacity
insert()
erase()
clear()
Operations
find()
Searches the container for an element equivalent to val and returns an iterator to it if found, otherwise it returns an iterator to set::end.iterator find (const value_type& val);
count()
lower_bound()
upper_bound()