On Tuesday 11 May 2004 12:27 pm, Cyrille Damez wrote:
So if I understood correctly, I was misunderstanding what a descriptor is supposed to be. In my particular case, the graph structure is actually a triangle mesh: the graph vertices are the mesh triangles (resp. the graph edges are mesh edges) and have non-const access to their edges (resp. the triangles that contain them).
Interesting.
Therefore, returning non-const iterators that could in turn return descriptors was conflicting with the constness of the graph.
This is correct.
So if I'm not mistaken, a descriptor should be something like a container for whatever additional information I am supposed to carry with my graph (here geometric data like 3D positions, normals, etc.), and shouldn't have the right to modify anything related to the graph topology. Therefore I should make all topological informations const in the vertex_descriptor and edge_descriptor classes and only enable changes to the topology through the mesh/graph object.
Descriptors are more like a key or index into a container that represents those attributes... So if all your vertices are stored into a vector, the descriptor could be the index into that vector. If your vertices were stored in an STL map, the descriptor could be the key into that map. In both cases, it's the constness of the container (vector or map) that matters, not the constness of the descriptor (key or index). Doug