|
FE 0.14.0
A C++23 toolkit for writing compiler/interpreter frontends.
|
An immutable set - really just a tagged pointer, so copy it around freely. More...
#include <fe/patricia.h>
Classes | |
| class | iterator |
| Yields the D* in ascending Key::key order. More... | |
Public Member Functions | |
Construction | |
| constexpr | Set () noexcept=default |
| The empty set. | |
| constexpr | Set (D *d) noexcept |
| The singleton \(\{d\}\) - stored inline, so this allocates nothing. | |
Getters | |
| size_t | size () const noexcept |
| constexpr bool | empty () const noexcept |
| constexpr | operator bool () const noexcept |
| Not empty? | |
| D * | min () const noexcept |
| Smallest id - or nullptr. | |
| D * | max () const noexcept |
| Largest id - or nullptr. | |
Check Membership | |
| bool | contains (D *d) const noexcept |
| bool | has_intersection (Set other) const noexcept |
| Is \(this \cap other \neq \emptyset\)? | |
| bool | subset_of (Set other) const noexcept |
| Is \(this \subseteq other\)? | |
Iterators | |
Ascending by id, compared as unsigned. | |
| iterator | begin () const noexcept |
| iterator | end () const noexcept |
| template<class F> | |
| void | for_each (F &&f) const |
| Like iterating, but without the iterator's path stack. | |
Comparisons | |
Everything is hash-consed and a singleton is always Uniq, so this compares contents in O(1). | |
| constexpr bool | operator== (Set other) const noexcept |
Output | |
| std::ostream & | stream (std::ostream &os) const |
| void | dump () const |
| void | dot (std::ostream &os) const |
Friends | |
| class | Patricia |
| std::ostream & | operator<< (std::ostream &os, Set s) |
An immutable set - really just a tagged pointer, so copy it around freely.
Definition at line 143 of file patricia.h.
|
constexprdefaultnoexcept |
The empty set.
Referenced by fe::Patricia< D, KT, K, N >::erase(), and fe::Patricia< D, KT, K, N >::insert().
|
inlineexplicitconstexprnoexcept |
The singleton \(\{d\}\) - stored inline, so this allocates nothing.
Definition at line 269 of file patricia.h.
|
inlinenoexcept |
Definition at line 340 of file patricia.h.
References fe::Patricia< D, KT, K, N >::Set::iterator::iterator().
|
inlinenoexcept |
Definition at line 292 of file patricia.h.
|
inline |
|
inline |
Definition at line 380 of file patricia.h.
References stream().
|
inlineconstexprnoexcept |
Definition at line 283 of file patricia.h.
Referenced by fe::Patricia< D, KT, K, N >::diff(), has_intersection(), fe::Patricia< D, KT, K, N >::insert(), fe::Patricia< D, KT, K, N >::intersect(), fe::Patricia< D, KT, K, N >::merge(), operator bool(), size(), and subset_of().
|
inlinenoexcept |
Definition at line 341 of file patricia.h.
|
inline |
Like iterating, but without the iterator's path stack.
Definition at line 345 of file patricia.h.
|
inlinenodiscardnoexcept |
Is \(this \cap other \neq \emptyset\)?
Definition at line 295 of file patricia.h.
References empty(), has_intersection(), and fe::unreachable().
Referenced by has_intersection().
|
inlinenoexcept |
Largest id - or nullptr.
Definition at line 287 of file patricia.h.
|
inlinenoexcept |
Smallest id - or nullptr.
Definition at line 286 of file patricia.h.
|
inlineexplicitconstexprnoexcept |
|
inlineconstexprnoexcept |
Definition at line 361 of file patricia.h.
|
inlinenoexcept |
|
inline |
Definition at line 366 of file patricia.h.
Referenced by dump(), and operator<<.
|
inlinenodiscardnoexcept |
Is \(this \subseteq other\)?
Definition at line 318 of file patricia.h.
References empty(), size(), and subset_of().
Referenced by subset_of().
|
friend |
Definition at line 455 of file patricia.h.
References stream().
|
friend |