Hi,
In order to understand bundled properties better, I tried to compile the example given in the link below. the code is pasted here: it gives a segmentation violation...
using namespace std;
using namespace boost;
struct City
{
string name;
int population;
vector<int> zipcodes;
};
struct Highway
{
string name;
double miles;
int speed_limit;
int lanes;
bool divided;
};
typedef boost::adjacency_list< boost::listS, boost::vecS, boost::bidirectionalS,City, Highway> Map;
int main(){
Map map; // load the map
Map::vertex_descriptor v = *vertices(map).first;
map[v].name =
"Troy";
map[v].population = 49170;
map[v].zipcodes.push_back(12180);
Map::edge_descriptor e = *out_edges(v, map).first;
map[e].name = "I-87";
map[e].miles = 10;
map[e].speed_limit = 65;
map[e].lanes = 4;
map[e].divided = true;
}
How do I add memory for vertices in the above example?
suresh