Boost logo

Boost Users :

From: Douglas Gregor (dgregor_at_[hidden])
Date: 2007-09-11 10:37:50


Jacques Papper wrote:
> I'm new to Boost and the graph library and I don't understand why my
> compiler complains :
>
> error: no matching function for call to `add_edge(int, int,
> boost::compressed_sparse_row_graph<boost::directedS, void, void,
> boost::no_property, size_t, size_t>&)'
>
> My code is copied underneath : I'm trying to simply create a CSR graph
> and add an edge ... from the CSR header I see that add_edge is an inline
> function (same as add_vertex etc...)... Why does this not work ?
>
It's a template argument deduction failure, because you are passing
"int" values where it is expecting "size_t" values... I believe we have
fixed this in Boost's Subversion repository, but to work around the
problem please use, e.g.,

    add_edge(std::size_t(3), std::size_t(4), csr);

  - Doug


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net