Boost logo

Boost Users :

From: stas_fomin (stas_fomin_at_[hidden])
Date: 2002-06-18 11:30:49

 I a newbie in BGL and I rewrite my LEDA code now...

 I have to sort (order) edges according to some functor.

For example (simplified):

typedef adjacency_list<vecS, vecS, bidirectionalS> MyGraph;
typedef graph_traits < MyGraph >::edge_descriptor MyGraphEdge;
typedef graph_traits < MyGraph >::edge_iterator MyEdgeIter;

class MyCompareEdges{
    bool operator()(MyGraphEdge e1, MyGraphEdge e2) const
                  return true;


                MyGraph Gr(10);
                MyEdgeIter ei_beg, ei_end;
                MyCompareEdges comp;
                tie(ei_beg, ei_end) = edges(Gr);
                std::sort(ei_beg, ei_end, comp); //Error C2676

And I have error C2676 (below the message...).

   1. Is it possible to sort edges in the graph?
   2. How to...

      Thanks all in advance...
        Stas Fomin.

   vecS, setS, listS for edge container... - C2676.

d:\projects\lib\cpp_libs\libboost\boost\iterator_adaptors.hpp(264) :
error C2676: binary '+=' : 'class std::list<struct
boost::list_edge<unsigned int,struct boost::no_property>,class
std::allocator<struct boost::list_edge<unsigned int,struct boost::
no_property> > >::iterator' does not define this operator or a
conversion to a type acceptable to the predefined operator
(911) : see reference to function template instantiation 'void
__thiscall boost::default_iterator_policies::advance(struct
boost::iterator_adaptor<class std::list<struct boost::lis
t_edge<unsigned int,struct boost::no_property>,class
std::allocator<struct boost::list_edge<unsigned int,struct
boost::no_property> > >::iterator,struct
boost::detail::edge_desc_impl<struct boost::b
idirectional_tag,unsigned int>,class
boost::bidirectional_tag,unsigned int>,class
boost::bidirectional_tag,unsigned int> *,struct
boost::multi_pass_input_iterator_tag,int> &,i
nt)' being compiled
Error executing cl.exe.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at