Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL Properties
From: David Doria (daviddoria_at_[hidden])
Date: 2011-01-27 10:07:32


> You need to specify the vertex properties as empty (something like
> "no_property" IIRC). You did specify the edge weight as the parameter of the
> VertexProperties, but it should look like this:
> adjacency_list<OutEdgeList, VertexList, Directed,
>               VertexProperties, EdgeProperties,
>               GraphProperties, EdgeList>
>
> The g++-4.3.4 output contains something like "Value =
> boost::detail::error_property_not_found" which tells you that some property
> was not available while you tried to access it.

Cedric,

Ah, thanks. One problem was I was indeed trying to specify the edge
property type in the template parameter for the vertex property type.

Now I am trying to simply assign a property to a vertex. I have:

typedef boost::property<boost::vertex_property_tag, double>
VertexProperty; // a double property
typedef boost::adjacency_list<boost::vecS, boost::vecS,
boost::undirectedS, VertexProperty> Graph;

int main(int,char*[])
{
  // Create a graph object
  Graph g(3);

  boost::add_vertex(g);
  boost::property_map<Graph, VertexProperty>::type value =
get(VertexProperty(), g);
  boost::put(value, 0, 1.2);
}

On the property_map call, I get an "error: invalid use of void expression"

What is wrong with this?

Thanks for your help so far,

David


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