title: Boost BGL: Edge property maps?
body: <p>I'm trying to make a graph given a list of connected edges, but my edges have both a score (a weight) and a trans (an user-defined data type which is basically a transformation matrix from one point to the other). I've tried a whole bunch of ways to do this, but every website I checked (including stackoverflow) has a different way of doing this which doesn't 100% fit my problem. I've tried all of them, but for now I've settled for the following:</p>
  
  <pre><code>struct EdgeInfoProperty{
      int score;
      Trans trans;
  };
  
  typedef boost::adjacency_list&lt;boost::listS, boost::vecS, boost::directedS, boost::no_property, EdgeInfoProperty &gt; mygraph;
  typedef mygraph::edge_descriptor Edge;
  
  mygraph G;
  
  for (i..i++){//some is
      for(j..j++){//some js
          boost::graph_traits&lt;mygraph&gt;::vertex_descriptor u, v;
          u = vertex(i, G);
          v = vertex(j, G);
          EdgeInfoProperty property_uv;
          property_uv.score=s[i]+s[j];//some score
          property_uv.trans = T[i]*T[j];
          boost::add_edge(u,v,property_uv,G);
      }
  }
  </code></pre>
  
  <p>But from what I can tell from most of the sites, declaring just one struct isn't enough...</p>
  
  <p>Indeed, now when I try to print out my graph:</p>
  
  <pre><code>typedef boost::property_map&lt;mygraph, boost::vertex_index_t&gt;::type IndexMap;
  IndexMap index = get(boost::vertex_index, G);
  
  std::cout &lt;&lt; "vertices(g) = ";
  typedef boost::graph_traits&lt;mygraph&gt;::vertex_iterator vertex_iter;
  std::pair&lt;vertex_iter, vertex_iter&gt; vp;
  for (vp = boost::vertices(G); vp.first != vp.second; ++vp.first)
      std::cout &lt;&lt; index[*vp.first] &lt;&lt;  " ";
  std::cout &lt;&lt; std::endl;
  
  std::cout &lt;&lt; "edges(g) = ";
  boost::graph_traits&lt;mygraph&gt;::edge_iterator ei, ei_end;
  for (boost::tie(ei, ei_end) = edges(G); ei != ei_end; ++ei)
      //----- how do I get the edge property?
      //EdgeInfoProperty prop = boost::get(EdgeInfoProperty, *ei);
      std::cout &lt;&lt; "(" &lt;&lt; index[source(*ei, G)]&lt;&lt; "," &lt;&lt; index[target(*ei, G)] &lt;&lt; ") ";
  </code></pre>
  
  <p>When I try to get the <code>EdgeInfoProperty</code> prop so that I can eventually print out <code>prop.score</code>, I get </p>
  
  <pre><code>error C2275: 'ConnGraph::MakeKinectGraph::EdgeInfoProperty' : illegal use of this type as an expression
  </code></pre>
  
  <p>Help. This is for a research project and if I can't surpass this I won't be able to get to the more interesting part...</p>