![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A Set is a structure that contains arbitrary elements. More...
Classes | |
| class | gum::Set< Key > |
| Representation of a set. More... | |
| class | gum::SetIteratorSafe< Key > |
| Safe iterators for the Set class. More... | |
| class | gum::SetIterator< Key > |
| Unsafe iterators for the Set class. More... | |
A Set is a structure that contains arbitrary elements.
Note that, as in mathematics, an element cannot appear twice in a given set. Sets have unsafe and safe iterators. The safe iterators (SetIteratorSafe<> a.k.a. Set<>::iterator_safe are slightly slower than the unsafe ones (SetIterator<> a.k.a. Set<>::iterator) but they guarantee that even if they point to a deleted element, using their operators ++ or * cannot produce a segfault. In such cases, they simply raise an exception. On the contrary, unsafe iterators should never be used on elements that can be deleted because, as in the STL, they will most probably produce a segfault.