[graph] ambiguity moving from 1.48 to 1.54

Hi, I'm in the process of upgrading from boost 1.48 to 1.54. We're using MSVC10. Most stuff that comes up is easy to fix, but this one gives me headaches: ...boost\boost_1_54_0\boost/pending/property.hpp(108): error C2752: 'boost::lookup_one_property_internal<PList,PropName>' : more than one partial specialization matches the template argument list with [ PList=boost::property<boost::edge_bundle_t,EdgeData>, PropName=boost::edge_bundle_t ] ...boost\boost_1_54_0\boost/pending/property.hpp(114): could be 'boost::lookup_one_property_internal<boost::property<Tag,T,Base>,Tag>' ...boost\boost_1_54_0\boost/pending/property.hpp(108): or 'boost::lookup_one_property_internal<boost::property<Tag,T,Base>,boost::edge_bundle_t>' ...boost\boost_1_54_0\boost/pending/property.hpp(108): or 'boost::lookup_one_property_internal<T,boost::edge_bundle_t>' ...boost\boost_1_54_0\boost/pending/property.hpp(158) : see reference to class template instantiation 'boost::lookup_one_property_internal<PList,PropName>' being compiled with [ PList=boost::property<boost::edge_index_t,int,boost::property<boost::edge_bundle_t,EdgeData>>, PropName=boost::edge_bundle_t ] ...boost\boost_1_54_0\boost/graph/detail/adjacency_list.hpp(1505) : see reference to class template instantiation 'boost::lookup_one_property<T,Tag>' being compiled with [ T=boost::property<boost::edge_index_t,int,boost::property<boost::edge_bundle_t,EdgeData>>, Tag=boost::edge_bundle_t ] ...boost\boost_1_54_0\boost/graph/detail/adjacency_list.hpp(2028) : see reference to class template instantiation 'boost::adj_list_helper<Config,Base>' being compiled with [ Config=boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config, Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config> ] ...boost\boost_1_54_0\boost/graph/adjacency_list.hpp(267) : see reference to class template instantiation 'boost::vec_adj_list_impl<Graph,Config,Base>' being compiled with [ Graph=boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>, Config=boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config, Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config> ] ..\graph_problem.cpp(52) : see reference to class template instantiation 'boost::adjacency_list<OutEdgeListS,VertexListS,DirectedS,VertexProperty,EdgeProperty>' being compiled with [ OutEdgeListS=boost::vecS, VertexListS=boost::vecS, DirectedS=boost::undirectedS, VertexProperty=VertexProps, EdgeProperty=EdgeProps ] ...boost\boost_1_54_0\boost/graph/adjacency_list.hpp(374): error C2182: '[]' : illegal use of type 'void' The code to reproduce is here: // boost #include <boost/graph/adjacency_list.hpp> #include <boost/graph/subgraph.hpp> #include <boost/graph/graph_traits.hpp> class EDGE {}; ////////////////////////////////////////////////////////////////////////// /// graph's vertex data struct VertexData { /// c-tor VertexData() { pos[0] = 0.0; pos[1] = 0.0; pos[2] = 0.0; } VertexData(const double* _pos) { pos[0] = _pos[0]; pos[1] = _pos[1]; pos[2] = _pos[2]; } /// data double pos[3]; }; ////////////////////////////////////////////////////////////////////////// /// graph's edge data struct EdgeData { /// c-tor EdgeData() : pEdge(NULL) {} EdgeData(EDGE* _pEdge) : pEdge(_pEdge) {} /// comparison for equality bool operator==(const EdgeData& dst) const { return pEdge == dst.pEdge; } /// data EDGE* pEdge; }; ////////////////////////////////////////////////////////////////////////// /// types typedef VertexData VertexProps; ///< custom vertex properties typedef boost::property<boost::edge_index_t, int, boost::property<boost::edge_bundle_t, EdgeData> > EdgeProps; ///< custom edge properties typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, VertexProps, EdgeProps> Type; ///< custom graph type ////////////////////////////////////////////////////////////////////////// /// unary predicate for testing if edge has duplicates in graph struct CheckDuplicateEdge { CheckDuplicateEdge(const Type& _g) : g(_g) {} // check if this edge has duplicates bool operator()(const Type::edge_descriptor& e) const { // do something return false; } private: const Type& g; }; ////////////////////////////////////////////////////////////////////////// void RemoveDuplicateEdges(Type& g) { remove_edge_if(CheckDuplicateEdge(g), g); } ////////////////////////////////////////////////////////////////////////// void main() { std::cout << "hello graph"; } ////////////////////////////////////////////////////////////////////////// I have tried to find a solution, and have searched the internet for hours. So, hopefully anybody here saw something similar, and solved it already. Rgds Richard

(snip)
////////////////////////////////////////////////////////////////////////// /// types typedef VertexData VertexProps; ///< custom vertex properties typedef boost::property<boost::edge_index_t, int, boost::property<boost::edge_bundle_t, EdgeData> > EdgeProps; ///< custom edge properties typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, VertexProps, EdgeProps> Type; ///< custom graph type
Instead of using boost::property<boost::edge_bundle_t, EdgeData>, just use EdgeData. edge_bundle_t is a built-in property map that should not be defined as a user property type. -- Jeremiah Willcock

Hi Jeremiah, that solved the compilation error. Funny enough, the simplified version doesn't work with boost 1.48. So I have to use an #if BOOST_VERSION ... if I want to be able to compile with bot. Thanks for your help Richard On Fr, 2013-10-25 at 10:43 -0400, Jeremiah Willcock wrote:
(snip)
////////////////////////////////////////////////////////////////////////// /// types typedef VertexData VertexProps; ///< custom vertex properties typedef boost::property<boost::edge_index_t, int, boost::property<boost::edge_bundle_t, EdgeData> > EdgeProps; ///< custom edge properties typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, VertexProps, EdgeProps> Type; ///< custom graph type
Instead of using boost::property<boost::edge_bundle_t, EdgeData>, just use EdgeData. edge_bundle_t is a built-in property map that should not be defined as a user property type.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

On Wed, 30 Oct 2013, Richi Lists wrote:
Hi Jeremiah,
that solved the compilation error. Funny enough, the simplified version doesn't work with boost 1.48. So I have to use an #if BOOST_VERSION ... if I want to be able to compile with bot.
That's odd -- what fails with 1.48? -- Jeremiah Willcock
participants (2)
-
Jeremiah Willcock
-
Richi Lists