|
|
| Set (const Set &)=default |
| |
|
| Set (Set &&) noexcept=default |
| |
|
| Set (const Vector< T > &l) |
| |
|
| Set (std::initializer_list< T > l) |
| |
|
Set & | operator= (const Set &)=default |
| |
|
Set & | operator= (Set &&) noexcept=default |
| |
| bool | contains (const T &t) const |
| |
|
auto | begin () const |
| |
|
auto | end () const |
| |
|
size_type | size () const |
| |
| size_type | erase (const key_type &key) |
| |
| void | clear () |
| |
| iterator | insert (iterator hint, const T &value) |
| |
|
std::pair< iterator, bool > | insert (const T &value) |
| |
template<typename T>
class hilti::rt::Set< T >
HILTI's Set is a std::set-like type with additional safety guarantees.
In particular it guarantees that iterators are either valid, or throw an exception when accessed.
If not otherwise specified, we follow the semantics on iterator invalidation of std::set with the caveat that iterators which cannot be dereferenced can become invalid through mutating Set operations. We still validate invalid dereferencing of such iterators.
rt::Set<int> set;
auto it = set.begin(); // Valid iterator which cannot be dereferenced.
// Mutating the set invalidates not dereferenceable iterators.
set.insert(1);
*it; // Iterator now invalid, throws.
If not otherwise specified, member functions have the semantics of std::set member functions.