Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2003-10-20 10:07:22


Hi Sashan,

It's hard to know exactly what's wrong without seeing all the code.
However, based on the change that removes the problem, I'd say that it
probably has to do with how the vertex_descriptor==int when
VertexList==vecS whereas vertex_descriptor==void* when VertexList==listS.
Anotherwords, somewhere in your code you are probably not treating
vertex_descriptor as opaque, but instead treating it as an int.

Hope that helps,
Jeremy

On Fri, 10 Oct 2003, sashan wrote:

sashan> I'm trying to use a vistitor class on a graph I have defined. The
sashan> visitor class is very simple and inherits from default_dfs_visitor:
sashan> class OpenGLVisitor :
sashan> public boost::default_dfs_visitor
sashan> {
sashan> public:
sashan> OpenGLVisitor(void);
sashan> virtual ~OpenGLVisitor(void);
sashan> };
sashan>
sashan> My graph type is:
sashan> typedef adjacency_list < vecS, listS, directedS > graph_t;
sashan>
sashan> The code to perform a dfs on the graph is as follows:
sashan> graph_t g;
sashan> depth_first_search(g, visitor(OGLVisitor));
sashan>
sashan> However I get the compiler error (see attachment).
sashan>
sashan> If I change the typedef to
sashan> typedef adjacency_list < vecS, vecS, directedS > graph_t;
sashan>
sashan> then there is no error. This seems odd since it should also work when
sashan> the vertices of the graph use the std::list as their container class.
sashan>
sashan> I'm using VC++7.1.
sashan>
sashan>

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net