On Jun 28, 2010, at 12:23 PM, Trevor Harmon wrote:
Design issues aside, I'm now trying to modify my graph code to use
subgraphs. To start off, I thought I would try changing my
adjacency_list to subgraph. Theoretically, my code
should still work the same way, right? But I'm getting compiler errors
when calling get().
I'm also getting compiler errors when calling add_vertex. Example:
#include
#include
using namespace boost;
class MyGraph :
public subgraph > > {
};
int main(int,char*[]) {
MyGraph g;
std::string v;
add_vertex(v, g);
return 0;
}
error: no matching function for call to ‘add_vertex(std::string&,
MyGraph&)’
/Users/twharmon/Development/boost_1_43_0/boost/graph/subgraph.hpp:346:
note: candidates are: typename
boost::subgraph<Graph>::vertex_descriptor boost::add_vertex(typename
boost::subgraph<Graph>::vertex_descriptor, boost::subgraph<Graph>&)
[with G = boost::adjacency_list,
boost::no_property, boost::listS>]
The error goes away if I take out "subgraph" or simply change the
vertex type from std::string to a primitive type, such as size_t or
double.
So... have I completely misunderstood how to use subgraphs? Or am I
encountering some sort of Boost bug?
Thanks,
Trevor