Boost logo

Boost Users :

From: sashan (sashang_at_[hidden])
Date: 2003-10-09 21:40:06


I'm trying to use a vistitor class on a graph I have defined. The
visitor class is very simple and inherits from default_dfs_visitor:
class OpenGLVisitor :
   public boost::default_dfs_visitor
{
public:
   OpenGLVisitor(void);
   virtual ~OpenGLVisitor(void);
};

My graph type is:
typedef adjacency_list < vecS, listS, directedS > graph_t;

The code to perform a dfs on the graph is as follows:
graph_t g;
depth_first_search(g, visitor(OGLVisitor));

However I get the compiler error (see attachment).

If I change the typedef to
typedef adjacency_list < vecS, vecS, directedS > graph_t;

then there is no error. This seems odd since it should also work when
the vertices of the graph use the std::list as their container class.

I'm using VC++7.1.


Build Log
  

------- Build started: Project: Render, Configuration: Debug|Win32 -------

Command Lines
  
Creating temporary file "e:\Code\Edge\Render\Debug\RSP00000F.rsp" with contents
[
/Od /I "../../boost" /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /GR /Yu"StdAfx.h" /Fp"Debug/Render.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
.\SceneGraph.cpp
]
Creating command line "cl.exe @e:\Code\Edge\Render\Debug\RSP00000F.rsp /nologo"
Output Window
  
Compiling...
SceneGraph.cpp
e:\Code\Edge\Render\SceneGraph.hpp(38) : warning C4267: 'return' : conversion from 'size_t' to 'int', possible loss of data
        e:\Code\boost\boost\iterator_adaptors.hpp(1409) : see reference to class template instantiation 'boost::filter_iterator_generator' being compiled
e:\Code\Edge\Render\SceneGraph.cpp(21) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
e:\Code\boost\boost\property_map.hpp(346) : 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)
        with
        [
            _Ty=boost::default_color_type
        ]
        e:\Code\boost\boost\property_map.hpp(346) : while compiling class-template member function 'boost::default_color_type boost::iterator_property_map::operator [](boost::iterator_property_map::key_type) const'
        with
        [
            RandomAccessIterator=std::vector::iterator,
            IndexMap=boost::detail::choose_pmap_helper,boost::vertex_index_t>::type,graph_t,boost::vertex_index_t>::const_result_type,
            T=boost::default_color_type,
            R=boost::default_color_type &
        ]
        e:\Code\boost\boost\graph\depth_first_search.hpp(157) : see reference to class template instantiation 'boost::iterator_property_map' being compiled
        with
        [
            RandomAccessIterator=std::vector::iterator,
            IndexMap=boost::detail::choose_pmap_helper,boost::vertex_index_t>::type,graph_t,boost::vertex_index_t>::const_result_type,
            T=boost::default_color_type,
            R=boost::default_color_type &
        ]
        e:\Code\boost\boost\graph\depth_first_search.hpp(230) : see reference to function template instantiation 'void boost::detail::dfs_dispatch::apply::result::type,boost::detail::choose_param_helper::result>::type,OpenGLVisitor,boost::graph_visitor_t,boost::no_property>(const VertexListGraph &,DFSVisitor,Vertex,const boost::bgl_named_params &,boost::detail::error_property_not_found)' being compiled
        with
        [
            VertexListGraph=graph_t,
            Default=std::allocator>,boost::listS,boost::listS,boost::undirectedS,boost::property,boost::no_property,boost::no_property,boost::listS>::config::vertex_ptr >::value_type ,
            Param=boost::property_value,boost::graph_visitor_t>::type,
            DFSVisitor=boost::detail::choose_param_helper,boost::graph_visitor_t>::type>::result>::type,
            Vertex=boost::detail::choose_param_helper::result>,boost::listS,boost::listS,boost::undirectedS,boost::property,boost::no_property,boost::no_property,boost::listS>::config::vertex_ptr >::value_type >::type,
            T=OpenGLVisitor,
            Tag=boost::graph_visitor_t,
            Base=boost::no_property
        ]
        e:\Code\Edge\Render\SceneGraph.cpp(39) : see reference to function template instantiation 'void boost::depth_first_search(const VertexListGraph &,const boost::bgl_named_params &)' being compiled
        with
        [
            VertexListGraph=graph_t,
            T=OpenGLVisitor,
            Tag=boost::graph_visitor_t,
            Base=boost::no_property
        ]
Results
  
Build log was saved at "file://e:\Code\Edge\Render\Debug\BuildLog.htm"
Render - 1 error(s), 2 warning(s)

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