boost - STL transform is not working with BGL -
i'm new bgl. i'm trying transform range of edges equivalent objects usable in system.
std::vector<my_obj*> return_value(distance(all_edges.first, all_edges.second)); std::transform(all_edges.first, all_edges.second, return_value.begin(), bind(&graph::transform, this, _1));
but i'm getting error couldn't understand:
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h: in function `_outputiterator std::transform(_inputiterator, _inputiterator, _outputiterator, _unaryoperation) [with _inputiterator =boost::detail::adj_list_edge_iterator<std::_list_iterator<void*>, boo st::detail::out_edge_iter<std::_list_iterator<boost::detail::sep_<void*, boost::property<boost:: edge_bundle_t, my_obj*, boost::no_property> > >, void*, boost::detail::edge_desc_impl<boost::dir ected_tag, void*>, ptrdiff_t>, boost::adjacency_list<boost::lists, boost::lists, boost::directed s, my_obj*, my_obj*, boost::no_property, boost::lists> >, _outputiterator = __gnu_cxx::__normal_ iterator<my_obj**, std::vector<my_obj*, std::allocator<my_obj*> > >, _unaryoperation = boost::la mbda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::action<3, boost::lambda:: function_action<3, boost::lambda::detail::unspecified> >, 2 boost::tuples::tuple<my_obj*(graph::*const)(boost::detail::edge_desc_impl<boost::directed_tag , void*>), graph* const, const boost::lambda::lambda_functor<boost::lambda::placeholder<1> >,boo st::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_t ype,boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >]': 3 isrc/icn_graph.cxx:70: instantiated here 4 /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algo.h:789: error: no match call `(boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost:: lambda::action<3, boost::lambda::function_action<3, boost::lambda::detail::unspecified> >, boost ::tuples::tuple<my_obj*(graph::*const)(boost::detail::edge_desc_impl<boost::directed_tag, void*> ), graph* const, const boost::lambda::lambda_functor<boost::lambda::placeholder<1> >, boost::tup les::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, bo ost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type> > >) (boost::detail: :edge_desc_impl<boost::directed_tag, void*>)' 5 /usr/include/boost/lambda/detail/lambda_functors.hpp:137: note: candidates are: typename t::sig< boost::tuples::null_type>::type boost::lambda::lambda_functor<base>::operator()() const [with t = boost::lambda::lambda_functor_base<boost::lambda::action<3, boost::lambda::function_action<3, boost::lambda::detail::unspecified> >, boost::tuples::tuple<my_obj*(graph::*const)(boost::detail ::edge_desc_impl<boost::directed_tag, void*>), graph* const, const boost::lambda::lambda_functor <boost::lambda::placeholder<1> >, boost::tuples::null_type, boost::tuples::null_type, boost::tup les::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, bo ost::tuples::null_type> >] 6 /usr/include/boost/lambda/detail/lambda_functors.hpp:145: note: typename t::sig< boost::tuples::tuple<a&, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null _type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tupl es::null_type, boost::tuples::null_type, boost::tuples::null_type> >::type boost::lambda::lambda _functor<base>::operator()(a&) const [with = boost::detail::edge_desc_impl<boost::directed_tag , void*>, t = boost::lambda::lambda_functor_base<boost::lambda::action<3, boost::lambda::functio n_action<3, boost::lambda::detail::unspecified>>, boost::tuples::tuple<my_obj*(graph::*const)(bo ost::detail::edge_desc_impl<boost::directed_tag, void*>), graph* const, const boost::lambda::lam bda_functor<boost::lambda::placeholder<1> >,boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type,boost::tuples::null_type, boost::tuples::null _type, boost::tuples::null_type> >] 7
why error?
what all_edges
here? if edges(g)
, value type of iterator edge_descriptor
, not my_obj*
. need apply different std::transform
functor gets edge property descriptor applies graph::transform
it.
Comments
Post a Comment