When I try to compile this code:
struct BasicVertexProperties
{
Vect3Df position;
};
struct BasicEdgeProperties
{
};
template < typename VERTEXPROPERTIES, typename EDGEPROPERTIES >
class Graph
{
typedef adjacency_list<
setS, // disallow parallel edges
vecS, // vertex container
bidirectionalS, // directed graph
property<vertex_properties_t, VERTEXPROPERTIES>,
property<edge_properties_t, EDGEPROPERTIES>
> GraphContainer;
typedef graph_traits<GraphContainer>::vertex_descriptor Vertex;
typedef graph_traits<GraphContainer>::edge_descriptor Edge;
};
g++ complains with the following error in the "typedef graph_traits<>" line:
error: type 'boost::graph_traits<boost::adjacency_list<boost::setS, boost::vecS,
boost::bidirectionalS, boost::property<vertex_properties_t, VERTEXPROPERTIES,
boost::no_property>, boost::property<edge_properties_t, EDGEPROPERTIES,
boost::no_property>, boost::no_property, boost::listS> >' is not derived from type
'Graph<VERTEXPROPERTIES, EDGEPROPERTIES>'
I found out that the compiler seems not to know that my template parameters are types, but putting "typename" before them in the property definition doesn't help.
What is wrong? I simply want to have a templated Graph class to have the possibility to use whatever properties I like, derived from the basic property structs defined above, so I can have methods in this Graph that operate on the basic properties.