title: boost graph library directed multigraph edge_range bug
body: <p>I have a directed multigraph with vertices A..C and edges E1..E4</p>
  
  <pre><code>A ---E1--&gt; B
  A ---E2--&gt; B
  A ---E3--&gt; B
  B ---E4--&gt; C
  </code></pre>
  
  <p>I wanted to iterate over the edges that connect A and B.</p>
  
  <p>In BGL, I expressed this as:</p>
  
  <pre><code>#include &lt;boost/graph/adjacency_list.hpp&gt;
  
  struct Vertex
  {
    std::string code;
  };
  
  struct Edge
  {
    double distance;
    std::string code;
  };
  
  int main()
  {
    using namespace boost;
    typedef adjacency_list&lt;listS, vecS, directedS, Vertex, Edge&gt; Graph;
    Graph g;
    auto a= add_vertex(Vertex{ "A" }, g);
    auto b= add_vertex(Vertex{ "B" }, g);
    auto c= add_vertex(Vertex{ "C" }, g);
    add_edge(a, b, Edge{ 10, "E1" }, g);
    add_edge(a, b, Edge{ 10, "E2" }, g);
    add_edge(a, b, Edge{ 10, "E3" }, g);
    add_edge(a, c, Edge{ 10, "E4" }, g);
  
    // checking number of edges
    std::cout&lt;&lt; num_edges(g)&lt;&lt; std::endl;
  
    // printing edges branching from A
    auto erange= out_edges(a, g);
    for(auto i= erange.first; i!= erange.second; ++ i)
      std::cout&lt;&lt; g[*i].code&lt;&lt; std::endl;
  
    // now we want to iterate over edges that connect A and B
    auto wtf= boost::edge_range(a, b, g);
  }
  </code></pre>
  
  <p>Which results in a compilation error:</p>
  
  <pre><code>In file included from /usr/include/boost/graph/adjacency_list.hpp:246:
  /usr/include/boost/graph/detail/adjacency_list.hpp:1617:25: error: no matching constructor for initialization of 'StoredEdge' (aka
        'boost::detail::stored_edge_property&lt;unsigned long, Edge&gt;')
          equal_range(el, StoredEdge(v, fake_edge_container.end(),
                      ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>I've read the documentation:</p>
  
  <p><code>std::pair&lt;out_edge_iterator, out_edge_iterator&gt;
  edge_range(vertex_descriptor u, vertex_descriptor v,
             const adjacency_list&amp; g)
  Returns a pair of out-edge iterators that give the range for all the parallel edges from u to v. This function only works when the OutEdgeList for the adjacency_list is a container that sorts the out edges according to target vertex, and allows for parallel edges. The multisetS selector chooses such a container.</code></p>
  
  <p>( <a href="http://www.boost.org/doc/libs/1_54_0/libs/graph/doc/adjacency_list.html" rel="nofollow">http://www.boost.org/doc/libs/1_54_0/libs/graph/doc/adjacency_list.html</a> )</p>
  
  <p>Modified the graph:</p>
  
  <pre><code>typedef adjacency_list&lt;multisetS, vecS, directedS, Vertex, Edge&gt; Graph;
  </code></pre>
  
  <p>But the error did not change.</p>
  
  <p>So how do you list edges between two vertices (from-> to) in a directed multigraph using BGL ?</p>
  
  <p>I found a quick and dirty way:</p>
  
  <pre><code>auto erange= out_edges(a, g);$
  for(auto i= erange.first; i!= erange.second; ++ i)$
    std::cout&lt;&lt; g[*i].code&lt;&lt; " -&gt; "&lt;&lt; g[target(*i, g)].code&lt;&lt; std::endl;$
  </code></pre>
  
  <p>Which will let me filter edge by target vertex. But how do you use <code>boost::edge_range</code> ?</p>