Boost logo

Boost :

From: Chris Alvers (cab322_at_[hidden])
Date: 2005-09-03 11:07:50


I tried to do a depth_first_search with the following
graph type and visitor:

struct CycleDetector : public

  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::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)


Changing the graph type definition to:

typedef boost::adjacency_list<
                                boost::bidirectionalS> T_Graph;

(i.e. replacing the listS by vecS) works perfectly.

Is this a known restriction of the library ?

Best regards




Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:

Boost list run by bdawes at, gregod at, cpdaniel at, john at