Simple boost program throws exception

I'm trying boost for the first time on Codewarrior 8.0 for windows. The Boost version is 1.25.1 from the "Boost Graph Library" accompanying CD. The offensive code is : #include <boost/config.hpp> #include <iostream> #include <boost/graph/adjacency_list.hpp> using namespace boost; using namespace std; int main() { typedef adjacency_list<vecS,vecS,directedS, property < vertex_name_t, char >,property<edge_weight_t,double>
Graph;
property_map < Graph, vertex_name_t >::type name_map ; property_map < Graph, edge_weight_t >::type value_map ; Graph g; typename graph_traits<Graph>::vertex_descriptor a,b; a = add_vertex(g); name_map[a] = 'a'; b = add_vertex(g); name_map[b] = 'b'; typename graph_traits<Graph>::edge_descriptor ed; bool inserted; tie(ed, inserted) = add_edge(a, b, g); value_map[ed] = 1.2; return 0; } If the second template parameter for class VertexListS is replaced with listS it compiles and run normally. typedef adjacency_list<vecS,listS,directedS, property < vertex_name_t, char >,property<edge_weight_t,double>
Graph;
Can you please advise why? Best Regards

Hi, On December 7th I've posted this message, which unfortunately didn't get any reply. I'm not a professional programmer, so forgive me if it is a silly question, but your cooperation will help me understand boost better, thank you and happy new year to all. --- In Boost-Users@yahoogroups.com, "ksaleh2 <ksaleh2@y...>" <ksaleh2@y...> wrote:
I'm trying boost for the first time on Codewarrior 8.0 for windows. The Boost version is 1.25.1 from the "Boost Graph Library" accompanying CD. The offensive code is :
#include <boost/config.hpp> #include <iostream>
#include <boost/graph/adjacency_list.hpp>
using namespace boost; using namespace std;
int main() { typedef adjacency_list<vecS,vecS,directedS, property < vertex_name_t, char ,property<edge_weight_t,double>
Graph;
property_map < Graph, vertex_name_t >::type name_map ; property_map < Graph, edge_weight_t >::type value_map ;
Graph g;
typename graph_traits<Graph>::vertex_descriptor a,b;
a = add_vertex(g); name_map[a] = 'a'; b = add_vertex(g); name_map[b] = 'b';
typename graph_traits<Graph>::edge_descriptor ed; bool inserted;
tie(ed, inserted) = add_edge(a, b, g); value_map[ed] = 1.2;
return 0; }
If the second template parameter for class VertexListS is replaced with listS it compiles and run normally.
typedef adjacency_list<vecS,listS,directedS, property < vertex_name_t, char ,property<edge_weight_t,double>
Graph;
Can you please advise why?
Best Regards
participants (1)
-
ksaleh2 <ksaleh2@yahoo.com>