boostorg / graph

Boost.org graph module
http://boost.org/libs/graph
325 stars 208 forks source link

topo-sort1.cpp fails to compile if included header file order is changed #136

Open JohnCoconut opened 5 years ago

JohnCoconut commented 5 years ago

I found the error when my editor uses clang-format to format the code.

Example directory has a file topo-sort1.cpp. It includes two header files from bgl library.

/* ommited */
#include <boost/graph/vector_as_graph.hpp>
#include <boost/graph/topological_sort.hpp>

If I change the order to

/* ommited */
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/vector_as_graph.hpp>

gcc-8.2 compiler shows a error message shown below.

(The error message is also saved as a text file errorlog.txt, if you wish to read on your terminal.)

In file included from /usr/include/boost/graph/topological_sort.hpp:16,
                 from topo-sort1.cpp:12:
/usr/include/boost/graph/depth_first_search.hpp: In instantiation of ‘void boost::depth_first_search(const VertexListGraph&, DFSVisitor, ColorMap, typename boost::graph_traits<Graph>::vertex_descriptor) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; DFSVisitor = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; ColorMap = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >; typename boost::graph_traits<Graph>::vertex_descriptor = int]’:
/usr/include/boost/graph/depth_first_search.hpp:335:36:   required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Graph = std::vector<std::__cxx11::list<int> >]’
/usr/include/boost/graph/depth_first_search.hpp:342:5:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:345:3:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = std::vector<std::__cxx11::list<int> >; P = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; T = boost::graph_visitor_t; R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/topological_sort.hpp:65:23:   required from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; OutputIterator = std::front_insert_iterator<std::deque<int> >; P = boost::typed_identity_property_map<long unsigned int>; T = boost::vertex_index_t; R = boost::no_property]’
topo-sort1.cpp:42:61:   required from here
/usr/include/boost/graph/depth_first_search.hpp:232:43: error: no matching function for call to ‘vertices(const std::vector<std::__cxx11::list<int> >&)’
     for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) {
                                   ~~~~~~~~^~~
In file included from /usr/include/boost/graph/depth_first_search.hpp:18,
                 from /usr/include/boost/graph/topological_sort.hpp:16,
                 from topo-sort1.cpp:12:
/usr/include/boost/graph/graph_concepts.hpp:47:48: note: candidate: ‘template<class T> typename T::ThereReallyIsNoMemberByThisNameInT boost::vertices(const T&)’
 typename T::ThereReallyIsNoMemberByThisNameInT vertices(T const&);
                                                ^~~~~~~~
/usr/include/boost/graph/graph_concepts.hpp:47:48: note:   template argument deduction/substitution failed:
/usr/include/boost/graph/graph_concepts.hpp: In substitution of ‘template<class T> typename T::ThereReallyIsNoMemberByThisNameInT boost::vertices(const T&) [with T = std::vector<std::__cxx11::list<int> >]’:
/usr/include/boost/graph/depth_first_search.hpp:232:43:   required from ‘void boost::depth_first_search(const VertexListGraph&, DFSVisitor, ColorMap, typename boost::graph_traits<Graph>::vertex_descriptor) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; DFSVisitor = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; ColorMap = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >; typename boost::graph_traits<Graph>::vertex_descriptor = int]’
/usr/include/boost/graph/depth_first_search.hpp:335:36:   required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Graph = std::vector<std::__cxx11::list<int> >]’
/usr/include/boost/graph/depth_first_search.hpp:342:5:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:345:3:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = std::vector<std::__cxx11::list<int> >; P = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; T = boost::graph_visitor_t; R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/topological_sort.hpp:65:23:   required from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; OutputIterator = std::front_insert_iterator<std::deque<int> >; P = boost::typed_identity_property_map<long unsigned int>; T = boost::vertex_index_t; R = boost::no_property]’
topo-sort1.cpp:42:61:   required from here
/usr/include/boost/graph/graph_concepts.hpp:47:48: error: no type named ‘ThereReallyIsNoMemberByThisNameInT’ in ‘class std::vector<std::__cxx11::list<int> >’
In file included from /usr/include/boost/graph/topological_sort.hpp:16,
                 from topo-sort1.cpp:12:
/usr/include/boost/graph/depth_first_search.hpp: In instantiation of ‘void boost::depth_first_search(const VertexListGraph&, DFSVisitor, ColorMap, typename boost::graph_traits<Graph>::vertex_descriptor) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; DFSVisitor = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; ColorMap = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >; typename boost::graph_traits<Graph>::vertex_descriptor = int]’:
/usr/include/boost/graph/depth_first_search.hpp:335:36:   required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Graph = std::vector<std::__cxx11::list<int> >]’
/usr/include/boost/graph/depth_first_search.hpp:342:5:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:345:3:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = std::vector<std::__cxx11::list<int> >; P = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; T = boost::graph_visitor_t; R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/topological_sort.hpp:65:23:   required from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; OutputIterator = std::front_insert_iterator<std::deque<int> >; P = boost::typed_identity_property_map<long unsigned int>; T = boost::vertex_index_t; R = boost::no_property]’
topo-sort1.cpp:42:61:   required from here
/usr/include/boost/graph/depth_first_search.hpp:242:43: error: no matching function for call to ‘vertices(const std::vector<std::__cxx11::list<int> >&)’
     for (boost::tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) {
                                   ~~~~~~~~^~~
In file included from /usr/include/boost/graph/depth_first_search.hpp:18,
                 from /usr/include/boost/graph/topological_sort.hpp:16,
                 from topo-sort1.cpp:12:
/usr/include/boost/graph/graph_concepts.hpp:47:48: note: candidate: ‘template<class T> typename T::ThereReallyIsNoMemberByThisNameInT boost::vertices(const T&)’
 typename T::ThereReallyIsNoMemberByThisNameInT vertices(T const&);
                                                ^~~~~~~~
/usr/include/boost/graph/graph_concepts.hpp:47:48: note:   template argument deduction/substitution failed:
/usr/include/boost/graph/graph_concepts.hpp: In substitution of ‘template<class T> typename T::ThereReallyIsNoMemberByThisNameInT boost::vertices(const T&) [with T = std::vector<std::__cxx11::list<int> >]’:
/usr/include/boost/graph/depth_first_search.hpp:242:43:   required from ‘void boost::depth_first_search(const VertexListGraph&, DFSVisitor, ColorMap, typename boost::graph_traits<Graph>::vertex_descriptor) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; DFSVisitor = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; ColorMap = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >; typename boost::graph_traits<Graph>::vertex_descriptor = int]’
/usr/include/boost/graph/depth_first_search.hpp:335:36:   required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Graph = std::vector<std::__cxx11::list<int> >]’
/usr/include/boost/graph/depth_first_search.hpp:342:5:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:345:3:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = std::vector<std::__cxx11::list<int> >; P = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; T = boost::graph_visitor_t; R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/topological_sort.hpp:65:23:   required from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; OutputIterator = std::front_insert_iterator<std::deque<int> >; P = boost::typed_identity_property_map<long unsigned int>; T = boost::vertex_index_t; R = boost::no_property]’
topo-sort1.cpp:42:61:   required from here
/usr/include/boost/graph/graph_concepts.hpp:47:48: error: no type named ‘ThereReallyIsNoMemberByThisNameInT’ in ‘class std::vector<std::__cxx11::list<int> >’
In file included from /usr/include/boost/graph/depth_first_search.hpp:21,
                 from /usr/include/boost/graph/topological_sort.hpp:16,
                 from topo-sort1.cpp:12:
/usr/include/boost/graph/named_function_params.hpp: In instantiation of ‘static boost::detail::map_maker_helper<false, Graph, ArgPack, Value, PM>::map_type boost::detail::map_maker_helper<false, Graph, ArgPack, Value, PM>::make_map(const Graph&, Value, const PM&, const ArgPack&) [with Graph = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Value = boost::default_color_type; PM = int; boost::detail::map_maker_helper<false, Graph, ArgPack, Value, PM>::map_type = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >; typename boost::remove_const<typename boost::detail::override_const_property_t<typename boost::parameter::value_type<ArgPack, boost::graph::keywords::tag::vertex_index_map, int>::type, boost::vertex_index_t, Graph, boost::detail::parameter_exists<ArgPack, boost::graph::keywords::tag::vertex_index_map>::value>::result_type>::type = boost::typed_identity_property_map<long unsigned int>]’:
/usr/include/boost/graph/named_function_params.hpp:606:32:   required from ‘static boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::map_type boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::make_map(const Graph&, const ArgPack&, ValueType) [with Graph = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; MapTag = boost::graph::keywords::tag::color_map; ValueType = boost::default_color_type; boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::map_type = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >]’
/usr/include/boost/graph/named_function_params.hpp:621:70:   required from ‘typename boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::map_type boost::detail::make_property_map_from_arg_pack_gen<MapTag, ValueType>::operator()(const Graph&, const ArgPack&) const [with Graph = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; MapTag = boost::graph::keywords::tag::color_map; ValueType = boost::default_color_type; typename boost::detail::map_maker<Graph, ArgPack, MapTag, ValueType>::map_type = boost::shared_array_property_map<boost::default_color_type, boost::typed_identity_property_map<long unsigned int> >]’
/usr/include/boost/graph/depth_first_search.hpp:337:80:   required from ‘void boost::graph::detail::depth_first_search_impl<Graph>::operator()(const Graph&, const ArgPack&) const [with ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; Graph = std::vector<std::__cxx11::list<int> >]’
/usr/include/boost/graph/depth_first_search.hpp:342:5:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type boost::graph::depth_first_search_with_named_params(const Param0&, const ArgPack&) [with Param0 = std::vector<std::__cxx11::list<int> >; ArgPack = boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::visitor, const boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > > >, boost::parameter::aux::arg_list<boost::parameter::aux::tagged_argument<boost::graph::keywords::tag::vertex_index_map, const boost::typed_identity_property_map<long unsigned int> >, boost::parameter::aux::empty_arg_list> >; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const ArgPack&)>::type = void]’
/usr/include/boost/graph/depth_first_search.hpp:345:3:   required from ‘typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type boost::depth_first_search(const Param0&, const boost::bgl_named_params<T, Tag, Base>&) [with Param0 = std::vector<std::__cxx11::list<int> >; P = boost::topo_sort_visitor<std::front_insert_iterator<std::deque<int> > >; T = boost::graph_visitor_t; R = boost::bgl_named_params<boost::typed_identity_property_map<long unsigned int>, boost::vertex_index_t, boost::no_property>; typename boost::result_of<boost::graph::detail::depth_first_search_impl<Param0>(Param0, const typename boost::detail::convert_bgl_params_to_boost_parameter<boost::bgl_named_params<T, Tag, Base> >::type&)>::type = void]’
/usr/include/boost/graph/topological_sort.hpp:65:23:   required from ‘void boost::topological_sort(VertexListGraph&, OutputIterator, const boost::bgl_named_params<P, T, R>&) [with VertexListGraph = std::vector<std::__cxx11::list<int> >; OutputIterator = std::front_insert_iterator<std::deque<int> >; P = boost::typed_identity_property_map<long unsigned int>; T = boost::vertex_index_t; R = boost::no_property]’
topo-sort1.cpp:42:61:   required from here
/usr/include/boost/graph/named_function_params.hpp:580:30: error: ‘num_vertices’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                  num_vertices(g),
                  ~~~~~~~~~~~~^~~
In file included from topo-sort1.cpp:13:
/usr/include/boost/graph/vector_as_graph.hpp:188:3: note: ‘template<class EdgeList, class Alloc> typename std::vector<_Tp, _Alloc>::size_type boost::num_vertices(const std::vector<_Tp, _Alloc>&)’ declared here, later in the translation unit
   num_vertices(const std::vector<EdgeList, Alloc>& v)
   ^~~~~~~~~~~~
anadon commented 5 years ago

So this suggests includes somewhere along the line aren't including all of their required resources. I'm stepping back for a bit to get better with C++, but when I get back I'll tend to this if it is still a problem.