Hi,
I'm trying to use the concepts in the Kevin Bacon example in my code and
am having trouble with compiling.
http://www.boost.org/libs/graph/doc/kevin_bacon.html
When I compiled the example by itself, it ran fine. However when I
changed it to my data, then it gave me a compile error of "error C2106:
'=' : left operand must be l-value"
I don't know why this is, other than variable name, I just changed the
vertex type from string to index. Nothing that I can see would cause
this.
The line not compiling is "grid_id[u] = gid;" See below for code.
************************************************************************
****************************
typedef property_map::type
vertexID_MapType;
typedef property_map::type
edgeID_MapType;
vertexID_MapType grid_id = get(vertex_index, interfaceGraph);
edgeID_MapType connectingElement_id = get(edge_index, interfaceGraph);
typedef graph_traits<ConnectionGraph>::vertex_descriptor Vertex;
typedef std::map NameVertexMap;
NameVertexMap edges;
for(CELAS2::iterator itr = CELAS2s.begin();itr != CELAS2s.end(); ++itr )
{
long gid = (*itr)->getSideA_1Grid();
NameVertexMap::iterator pos;
bool inserted = false;
Vertex u, v;
tie(pos, inserted) = edges.insert(std::make_pair(gid,
Vertex()));
if (inserted)
{
u = add_vertex(interfaceGraph);
grid_id[u] = gid; <<<<-------- ************ this
is the line that VS is saying non l-value. ****************
pos->second = u;
}
else
u = pos->second;
}
************************************************************************
***************************
Any ideas why this is? I'm confused as to what's causing this.
Any other way to populate the property map?
I'm using VS2005 and boost 1.33.1.
Thanks!