Я знаю, что это может быть очевидно, но потерпите меня, мой общий опыт программирования слаб.
Это код, который я пытаюсь скомпилировать:
#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE
#include <boost/graph/compressed_sparse_row_graph.hpp>
#include <vector>
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;
using namespace boost;
using namespace std;
typedef compressed_sparse_row_graph<directedS,void,void,no_property,uint32_t,uint64_t> intl_graph;
typedef std::pair<uint32_t,uint32_t> E;
int main()
{
intl_graph g;
vector<E> the_edges;
uint32_t nv = 3;
uint64_t nedge;
the_edges.push_back(E(0,1));
the_edges.push_back(E(1,2));
g = intl_graph(edges_are_unsorted_t,the_edges.begin(),the_edges.end(),nv); //line 24
}
, что приводит к этой ошибке:
boost_eg.cpp: In function âint main()â:
boost_eg.cpp:24: error: expected primary-expression before â(â token
boost_eg.cpp:24: error: expected primary-expression before â,â token
Если я изменю строку 24 на эту:
intl_graph g_(edges_are_unsorted_t,the_edges.begin(),the_edges.end(),nv);
ошибка такова:
boost_eg.cpp: In function âint main()â:
boost_eg.cpp:24: error: âthe_edgesâ is not a type
boost_eg.cpp:24: error: expected â,â or â...â before â.â token
Есть мысли?
Ссылка здесь:
http://www.boost.org/doc/libs/1_49_0/libs/graph/doc/compressed_sparse_row.html