Boost logo

Boost Users :

From: Ferng, Andrew D (andrew.d.ferng_at_[hidden])
Date: 2007-11-02 15:26:04


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<ConnectionGraph, vertex_index_t>::type
vertexID_MapType;
typedef property_map<ConnectionGraph, edge_index_t>::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<long,Vertex> 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!


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