Boost logo

Boost :

Subject: [boost] [range] Problem with adaptors::map_keys
From: Alexander Fokin (apfokin_at_[hidden])
Date: 2010-11-28 08:33:42

I'm having some troubles using adaptors::map_keys with custom
iterators over Qt associative containers.

The problem with Qt associative containers is that they provide
iterators over a set of values, not over a set of key-value pairs. I
have worked that around by introducing boost range bindings:

However, when these binding are used, the following code produces a
compilation error:

BOOST_FOREACH(auto pair, (QMap<int, int>()) | boost::adaptors::map_keys);

Everything works fine if the code of boost::range_detail::select_first
is slightly modified. You'll find the patch attached.

I believe it's a problem in boost range, but I may be wrong, so I need
some expert help here.

Best regards,
  Alexander Fokin,

Boost list run by bdawes at, gregod at, cpdaniel at, john at