On Dec 19, 2007 2:05 AM, tonyaim83
Hi..
My Sample Previous code look like
#include "src-graphml.hpp" using namespace std; using namespace boost;
int main(int argc, char** argv) { typedef adjacency_list
, property > graph_t; graph_t g; dynamic_properties dp; dp.property("color",get(vertex_name_t(),g)); dp.property("weight",get(edge_weight_t(),g)); return 0; } Now i have added one more property to the vertex and i m using bundled property for declaration.So now my code look like..
#include "src-graphml.hpp"
using namespace std; using namespace boost;
struct node { string name; string path; };
int main(int argc, char** argv) { typedef adjacency_list
> graph_t; graph_t g; dynamic_properties dp; dp.property("name",g().name); dp.property("file",g[*node].path);
dp.property("weight",get(edge_weight, g)); return 0; }
I have quoted with bold tag the one in which i m getting compilation error just let me know how to use it correctly.. Thanks in advance..
I don't know which line you intended to put in bold, but doesn't the following look strange to you?
dp.property("name",g().name); dp.property("file",g[*node].path);
Why not try "get(&node::name, g)" to get the node::name property instead of "g().name", and "get(&node::path,g)" instead of "g[*node].path" to get the node::path property? Regards, Aaron