mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
allow edge_descriptors to be created from pair<edge_descriptor, bool>
This commit is contained in:
@@ -328,6 +328,15 @@ public:
|
||||
edge_descriptor() : p(nullptr), serial(0) { }
|
||||
explicit edge_descriptor(edge_node *pp) : p(pp), serial(pp->serial) { }
|
||||
|
||||
/* Convenice ctor to allow us to directly get an edge_descriptor from
|
||||
* edge() and add_edge(). As we have null_edges and we always allow
|
||||
* parallel edges, the bool component of the return from these functions
|
||||
* is not required. */
|
||||
edge_descriptor(const std::pair<edge_descriptor, bool> &tup)
|
||||
: p(tup.first.p), serial(tup.first.serial) {
|
||||
assert(tup.second == (bool)tup.first);
|
||||
}
|
||||
|
||||
operator bool() const { return p; }
|
||||
bool operator<(const edge_descriptor b) const {
|
||||
if (p && b.p) {
|
||||
|
Reference in New Issue
Block a user