|
Boost Users : |
From: Bayle Shanks (bshanks2_at_[hidden])
Date: 2004-06-01 23:57:49
I have another question. The following code won't compile. But if you
change the first "listS" to "vecS", then it does. I can't find
anything in the docs which forbids the use of "degree" with
adjacency_list <listS, listS, ...
-------------
#include <boost/config.hpp>
#include <list>
#include <boost/graph/adjacency_list.hpp>
using namespace boost;
using namespace std;
typedef property<vertex_color_t, default_color_type,
property<vertex_distance_t,std::size_t,
property<vertex_degree_t,std::size_t,
property<vertex_in_degree_t, std::size_t,
property<vertex_out_degree_t,std::size_t> > > > >
VertexProperty;
typedef adjacency_list<listS, listS, bidirectionalS,
VertexProperty> Graph;
typedef boost::graph_traits<Graph>::vertex_descriptor vertexType;
int main(int, char*[])
{
Graph g;
vertexType v0;
v0 = add_vertex(g);
out_degree(v0, g);
}
-----------
the compile error is:
-----------
/usr/include/boost/iterator/iterator_traits.hpp: In function `void
std::distance(_InputIterator, _InputIterator, _Distance&) [with
_InputIterator = std::_List_iterator<boost::detail::sei_<size_t,
std::_List_iterator<boost::list_edge<size_t, boost::no_property>,
boost::list_edge<size_t, boost::no_property>&,
boost::list_edge<size_t,
boost::no_property>*>, boost::no_property>, const
boost::detail::sei_<size_t,
std::_List_iterator<boost::list_edge<size_t,
boost::no_property>, boost::list_edge<size_t, boost::no_property>&,
boost::list_edge<size_t, boost::no_property>*>,
boost::no_property>&, const
boost::detail::sei_<size_t,
std::_List_iterator<boost::list_edge<size_t,
boost::no_property>, boost::list_edge<size_t, boost::no_property>&,
boost::list_edge<size_t, boost::no_property>*>,
boost::no_property>*>,
_Distance = size_t]':
/usr/include/g++-v3/bits/stl_list.h:307: instantiated from `size_t
std::list<_Tp, _Alloc>::size() const [with _Tp =
boost::detail::sei_<size_t,
std::_List_iterator<boost::list_edge<size_t, boost::no_property>,
boost::list_edge<size_t, boost::no_property>&,
boost::list_edge<size_t, boost::no_property>*>, boost::no_property>,
_Alloc = std::allocator<boost::detail::sei_<size_t,
std::_List_iterator<boost::list_edge<size_t, boost::no_property>,
boost::list_edge<size_t, boost::no_property>&,
boost::list_edge<size_t, boost::no_property>*>, boost::no_property>
>]'
/usr/include/boost/graph/detail/adjacency_list.hpp:1409:
instantiated from `typename Config::degree_size_type
boost::out_degree(typename Config::vertex_descriptor, const
boost::adj_list_helper<Config, Base>&) [with Config =
boost::detail::adj_list_gen<boost::adjacency_list<boost::listS,
boost::vecS, boost::bidirectionalS, VertexProperty,
boost::no_property, boost::no_property, boost::listS>, boost::vecS,
boost::listS, boost::bidirectionalS, VertexProperty,
boost::no_property, boost::no_property, boost::listS>::config, Base =
boost::bidirectional_graph_helper_with_property<boost::detail::adj_list_gen<boost::adjacency_list<boost::listS,
boost::vecS, boost::bidirectionalS, VertexProperty,
boost::no_property, boost::no_property, boost::listS>, boost::vecS,
boost::listS, boost::bidirectionalS, VertexProperty,
boost::no_property, boost::no_property, boost::listS>::config>]'
graph2.cpp:26: instantiated from here
/usr/include/boost/iterator/iterator_traits.hpp:54:
`template<Iterator> struct
boost::iterator_category' is not a function,
/usr/include/g++-v3/bits/stl_iterator_base_types.h:196: conflict
with
`template<_Iter> typename std::iterator_traits::iterator_category
std::iterator_category(const _Iter&)'
/usr/include/g++-v3/bits/stl_iterator_base_funcs.h:102: in call to
`iterator_category'
-----------
thanks,
bayle
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net