Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-17 11:04:52


From: "Tim Culver" <tim.gmane_at_[hidden]>

> Also, I think the convention above might be a good alternative. I
> notice that the vertex descriptor does have a default constructor. My
> question is, does a default-constructed vertex descriptor act like a
> null value, in that it never corresponds to a valid vertex, and two
> nulls always compare equal?

Definitely not, and it shouldn't.
For many graph types, vertex_descriptor is an integer type which is a
zero-based index into the graph's vector of vertices. That's important for
efficiency.

> The documentation specifies that the
> default constructor and operator== must be defined, but the semantics
> are not specified.

Yup, that's by-design.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk