|
Boost Users : |
Subject: [Boost-users] Problems compiling with bundled properties and add_edge()
From: Eric Fowler (eric.fowler_at_[hidden])
Date: 2010-05-12 01:35:45
I am using bundled properties:
typedef unsigned position_type;
template<typename T>
class POS
{
public:
...
};
template<typename T>
struct LEN
{
T len_sq;
};
typedef POS<position_type> POSITION;
typedef LEN<position_type> LENGTH;
typedef adjacency_list<vecS, vecS, bidirectionalS, POSITION, LENGTH> DG;
typedef graph_traits<DG>::vertex_descriptor Vertex;
typedef graph_traits<DG>::edge_descriptor Edge;
...and I am calling add_edge() like this [from within the graph class so
(*this) resolves to the graph object]:
LENGTH l;
l.len_sq = whatever;
e01 = add_edge(v0, v1, l, *this);
The g++ compiler is punishing me with huge error reports that say:
../main.cpp: In constructor DelaunayGraph<T>::DelaunayGraph(const int&,
const int&) [with T = unsigned int]:
../main.cpp:126: instantiated from here
../main.cpp:101: error: no match for operator= in
((DelaunayGraph<unsigned int>*)this)->DelaunayGraph<unsigned int>::e01 =
boost::add_edge [with Graph = boost::adjacency_list<boost::vecS,
boost::vecS, boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>, Config =
boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>, boost::vecS, boost::vecS,
boost::bidirectionalS, boost::property<boost::vertex_bundle_t, POS<unsigned
int>, boost::no_property>, boost::property<boost::edge_bundle_t,
LEN<unsigned int>, 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::vecS,
boost::vecS, boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>, boost::vecS, boost::vecS,
boost::bidirectionalS, boost::property<boost::vertex_bundle_t, POS<unsigned
int>, boost::no_property>, boost::property<boost::edge_bundle_t,
LEN<unsigned int>, boost::no_property>, boost::no_property,
boost::listS>::config>](((DelaunayGraph<unsigned
int>*)this)->DelaunayGraph<unsigned int>::v0, ((DelaunayGraph<unsigned
int>*)this)->DelaunayGraph<unsigned int>::v1, ((const
boost::property<boost::edge_bundle_t, LEN<unsigned int>,
boost::no_property>&)(& boost::property<boost::edge_bundle_t, LEN<unsigned
int>, boost::no_property>(((const LEN<unsigned int>&)((const LEN<unsigned
int>*)(& l)))))),
((boost::vec_adj_list_impl<boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>,
boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>, boost::vecS, boost::vecS,
boost::bidirectionalS, boost::property<boost::vertex_bundle_t, POS<unsigned
int>, boost::no_property>, boost::property<boost::edge_bundle_t,
LEN<unsigned int>, boost::no_property>, boost::no_property,
boost::listS>::config,
boost::bidirectional_graph_helper_with_property<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,
boost::vecS, boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>, boost::vecS, boost::vecS,
boost::bidirectionalS, boost::property<boost::vertex_bundle_t, POS<unsigned
int>, boost::no_property>, boost::property<boost::edge_bundle_t,
LEN<unsigned int>, boost::no_property>, boost::no_property,
boost::listS>::config> >&)(&((DelaunayGraph<unsigned
int>*)this)->DelaunayGraph<unsigned
int>::<anonymous>.boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS, POS<unsigned int>, LEN<unsigned int>,
boost::no_property, boost::listS>::<anonymous>)))
/usr/include/boost/graph/detail/edge.hpp:35: note: candidates are:
boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>&
boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned
int>::operator=(const
boost::detail::edge_desc_impl<boost::bidirectional_tag, unsigned int>&)
make: *** [main.o] Error 1
Yow. It doesn't like the LENGTH param. What can I do? I tried adding an
assignment operator and copy constructor, no go. What am I doing wrong?
Eric
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