Boost logo

Boost :

From: Alexander Ivanov (amivanov_at_[hidden])
Date: 2005-11-18 14:03:09


Hello,

I'm experiencing the same behavior with following graph:

typedef boost::adjacency_list<setS, setS, directedS, ...> graph_t;
and then boost::depth_first_search would not take following visitor:

template<GraphT>
struct cycle_detector {
// ...
   template <typename EdgeT, typename GraphT>
   void back_edge(EdgeT E, GraphT& G) { /*...*/}
};

replacing VertexList param with vecS fixes the compilation error.
Could anyone confirm that is a known issue or otherwise what we're doing wrong?

--Alex

On 9/3/05, Chris Alvers <cab322_at_[hidden]> wrote:
> Hi,
>
> I tried to do a depth_first_search with the following
> graph type and visitor:
>
>
> struct CycleDetector : public
> boost::default_dfs_visitor
> {
>
> CycleDetector( bool& cycle ) : m_hasCycle(cycle) {};
> void back_edge( T_Edge, const T_Graph& ) {
> m_hasCycle = true; }
> bool& m_hasCycle;
> };
>
> typedef boost::adjacency_list<
> boost::setS,
> boost::listS,
> boost::bidirectionalS> T_Graph;
>
> bool hasCycle(false);
> CycleDetector cd(hasCycle);
> boost::depth_first_search(m_graph, visitor(cd));
>
>
> Compiling this on VC++ 7.1.3 (.NET Framework 1.1)
> results in the following error message:
>
> \boost\boost\property_map.hpp(349): 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
> ]
>
> ----------------------
>
> Changing the graph type definition to:
>
> typedef boost::adjacency_list<
> boost::setS,
> boost::vecS,
> boost::bidirectionalS> T_Graph;
>
> (i.e. replacing the listS by vecS) works perfectly.
>
> Is this a known restriction of the library ?
>
> Best regards
>
> Alex
>
>
>
>
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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