Boost logo

Boost Users :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-09-15 21:42:05


Hi Chris,

On Sun, 15 Sep 2002, Chris Russell wrote:
cdr> What determines when boost::get(Graph, vertex_myproperty_t) returns a
cdr> boost::property_map<graph_t, vertex_myproperty>::type vs. a
cdr> ::const_type?

The constness of the graph object that is passed to get().

cdr> vertex_myproperty_map_t MyMap = get(vertex_myproperty, Graph);
cdr>
cdr> ^--- this works as I expected. However, if I try to get a copy of my
cdr> property map this way inside a dfs visitor method, my compiler tells
cdr> me that
cdr> there's no suitable conversion from property_map<graph_t,
cdr> vertex_myproperty_t>::const_type to property_map<graph_t,
cdr> vertex_myproperty_t>::type (IA32 6.0 Intel compiler).

You've got a const graph object inside the visitor, so you need to use the
const property map.

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


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