Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-12-06 10:39:27


Today I (again) ran into an instance where I had a property map but really
wanted a function object. The code I wanted to write was:

  std::vector<vertex_descriptor> reversed_order(num_vertices(rdg));
  depth_first_search(rdg,
                         boost::visitor(
                           make_dfsnum_visitor(reversed_order.begin())));
  return transform(reverse_order.rbegin(), reverse_order.rend(),
                        out, get(symbol_tag(), rdg));

get(symbol_tag(), rdg) returns a property map now, so this code is ill-formed.
At the moment I either have to wrap the property map (yuck) or just fall back
to a hand-coded loop (also yuck).

Would anyone object if I made property maps into function objects? Any
downsides?

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk