
Hi, I have some troubles using boost::transpose_graph since boost 1.48. See the sample code. Fabien #include <boost/graph/graph_traits.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/copy.hpp> #include <boost/graph/transpose_graph.hpp> template<class GraphIn, class GraphOut> class Copier { public: Copier( const GraphIn& gIn, GraphOut& gOut ) : _gIn(gIn) , _gOut(gOut) {} template<class VIn, class VOut> void operator()(const VIn& vIn, VOut& vOut) { _gOut[vOut] = _gIn[vIn]; } private: const GraphIn& _gIn; GraphOut& _gOut; }; struct CustomVertex { }; struct CustomEdge { }; typedef boost::adjacency_list< boost::setS, // disallow parallel edges (OutEdgeList) boost::vecS, // vertex container (VertexList) boost::bidirectionalS, // directed graph CustomVertex, CustomEdge, boost::no_property, // no GraphProperty boost::listS // EdgeList
GraphContainer;
int main( int argc, char** argv ) { const GraphContainer a; GraphContainer b; Copier< GraphContainer, GraphContainer > copier( a, b ); // still works as before boost::copy_graph( a, b, boost::vertex_copy(copier).edge_copy(copier) ); // works with boost 1.47, but doesn't compile with boost 1.48 boost::transpose_graph( a, b, boost::vertex_copy(copier).edge_copy(copier) ); //<<<<< }

On Sun, 11 Dec 2011, Fabien Castan wrote:
Hi, I have some troubles using boost::transpose_graph since boost 1.48. See the sample code.
Please see if the latest trunk fixes this issue (I put in a few bug fixes just now); your code now compiles for me. -- Jeremiah Willcock

Please see if the latest trunk fixes this issue (I put in a few bug fixes just now); your code now compiles for me.
Yes, it fixes this problem but creates another one. See the updated sample code. Fabien #include <boost/graph/graph_traits.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/copy.hpp> #include <boost/graph/transpose_graph.hpp> template<class GraphIn, class GraphOut> class Copier { public: Copier( const GraphIn& gIn, GraphOut& gOut ) : _gIn(gIn) , _gOut(gOut) {} template<class VIn, class VOut> void operator()(const VIn& vIn, VOut& vOut) { _gOut[vOut] = _gIn[vIn]; } private: const GraphIn& _gIn; GraphOut& _gOut; }; struct CustomVertex { }; struct CustomEdge { }; typedef boost::adjacency_list< boost::setS, // disallow parallel edges (OutEdgeList) boost::vecS, // vertex container (VertexList) boost::bidirectionalS, // directed graph CustomVertex, CustomEdge, boost::no_property, // no GraphProperty boost::listS // EdgeList
GraphContainer;
int main( int argc, char** argv ) { const GraphContainer a; GraphContainer b; Copier< GraphContainer, GraphContainer > copier( a, b ); // still works as before boost::copy_graph( a, b, boost::vertex_copy(copier).edge_copy(copier) ); // works with boost 1.47, but doesn't compile with boost 1.48 // but works with the trunk version boost::transpose_graph( a, b, boost::vertex_copy(copier).edge_copy(copier) ); // works with boost 1.47 and 1.48, but doesn't work with the trunk version boost::transpose_graph( a, b ); //<<<<< }

On Sun, 11 Dec 2011, Fabien Castan wrote:
Please see if the latest trunk fixes this issue (I put in a few bug fixes just now); your code now compiles for me.
Yes, it fixes this problem but creates another one. See the updated sample code.
Please try the new version in the trunk. -- Jeremiah Willcock
participants (2)
-
Fabien Castan
-
Jeremiah Willcock