|
Boost Users : |
From: fuxiaowei (fuxiaowei9999_at_[hidden])
Date: 2003-11-24 23:48:02
Hello Jerermy:
I also meet the same problem. I recur it by using the BGL' sample dfs.cpp in which
I changed the default template parameter and use listS as edge selector, modify the
relevante addedge fuction. The compiler complains "error C2678: binary '+' : no
operator found which takes a left-hand operand of type
'const std::vector<_Ty>::iterator' (or there is no acceptable conversion ...".
I am also using the VC7.1. Thank you.
f_x_w
----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Monday, October 20, 2003 11:07 PM
Subject: Re: [BGL] Using default_dfs_visitor on a graph with std::list as the vertex type
> 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