Boost logo

Boost Users :

From: Sebastian Weber (sebastian.weber_at_[hidden])
Date: 2007-02-09 02:38:33


Hello everybody!

I'm using the property_map scheme to pass some data-structures to
vistors of BGL-algorithms. So far I usually use a vector in the manner:

std::vector<std::size_t> props(num_vertices(my_graph), 0)

Then I do something like

bfs_search(..., make_my_vistor(&props[0]), ...)

which works ok and passes me a correct property_map into the visitor
created by make_my_visitor. Within that visitor I can then do the usual
stuff like

put(the_props_map, vertex_id, someValue)

At least that's how I understood, how the property_map concept works.
However, if I use a bit-vector the above scheme breaks down to work:

std::vector<bool> bit_props(num_vertices(my_graph), false)

bfs_search(..., make_my_vistor(&bit_props[0]), ...)

The compiler compiles these lines, but complains that a temprorary is
passed as a reference to make_my_visitor and the code generated crashes.
My system is a Ubununtu Edgy with boost 1.33.1 and g++ 4.1.2. Any ideas
why this happens and what I can do here?

Thanks a lot in advance.

Greetings,

Sebastian


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