#include #include #include using namespace boost; using std::vector; struct bbox { int m_i; bbox(int i = 0) : m_i(i) {} }; typedef adjacency_list Graph; Graph G; int main() { vector A(10); std::generate(A.begin(), A.end(), rand); for (int i=0; i::vertex_iterator vi, vie; for (tie(vi, vie) = boost::vertices(G); vi != vie; ++vi) { std::cout << "Vertex descriptor: " << *vi << " has associated bbox " << boost::get(boost::vertex_bundle, G, *vi).m_i; std::cout << ", or equivalently " << boost::get(&bbox::m_i, G, *vi) << std::endl; } print_graph(G, boost::get(&bbox::m_i, G)); return 0; }