Boost logo

Boost Users :

From: Maarten Nieber (hallomaarten_at_[hidden])
Date: 2007-04-13 07:50:28


Hi all,

can anyone help me with the compile error I get when compiling the following code? I'm using the MSVC 7.1 compiler (but it is not an internal compiler error).

The error occurs in the last line.

Your help is appreciated!
With kind regards
Maarten

#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>

// Identifies the "component number" property
struct component_t
{
    enum { num = 4564 };
    typedef boost::vertex_property_tag kind;
};

void Test()
{
    using namespace boost;

    // The "component number" property is an integer for each vertex
    typedef boost::property<component_t, int> VertexComponentProperty;

    // A graph with list storage and the "component number" property.
    typedef boost::adjacency_list < boost::setS, boost::setS, boost::undirectedS, VertexComponentProperty > Graph;

    // The property map
    typedef boost::property_map<Graph, component_t>::type ComponentPropertyMap;

    Graph g;
    ComponentPropertyMap vertexToComponent = boost::get(component_t(), g);

    // THIS LINE DOES NOT COMPILE. No problem if boost::vecS is used instead of boost::setS in the Graph typedef!
    connected_components(g, vertexToComponent);
}

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



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