Short description of the problem:
Basically i want
struct Type;
typedef container<Type> MyType;
struct Type{
MyType::sometype member;
}
Now how to do it?
Actual problem:
For the Boost Succesive Shortest Path algorithm, I need the front edges to map to their opposite. I have the following code:
struct VertexProperty { };
struct EdgeProperty;
typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, VertexProperty, EdgeProperty> DirectedGraph;
struct EdgeProperty {
double edge_capacity;
double edge_weight;
DirectedGraph::edge_descriptor reverse_edge;
EdgeProperty(double distance, DirectedGraph::edge_descriptor reverseEdge) :
edge_capacity(1), edge_weight(distance), reverse_edge(reverseEdge) {
};
EdgeProperty(double distance) :
edge_capacity(0), edge_weight(-distance) {
};
};
However, now I get the following error:
/usr/include/boost/pending/property.hpp:35:7: error: ‘boost::property<Tag, T, Base>::m_value’ has incomplete type
../src/Tester.cpp:21:8: error: forward declaration of ‘struct EdgeProperty’
I assume this makes sense: for DirectedGraph :: edge_descriptor I need the full type of EdgeProperty, but this one, of course, is not initialized. How to solve this circular link?
source
share