Boost logo

Boost :

Subject: [boost] boost::adaptors::keys for mutable ranges of pairs
From: Valentin Ziegler (vziegler_at_[hidden])
Date: 2012-02-23 05:06:39


map.hpp defines two overloads for adaptors::values, one for
StdPairRange& and another for const StdPairRange const& rng. On the
other hand, there is just a single adaptors::keys which takes
StdPairRange const&. In particular, the code below will not compile:


Therefore, I would propose an adaptors::keys(StdPairRange& rng) overload
similar to adaptors::values(StdPairRange&). Iterators of the returned
range shall have a mutable base iterator. Further, iterators of the
returned range should have a reference type of
range_value<StdPairRange>::type::first_type& , so the elements in keys
are mutable where StdPairRange admits this.


Valentin Ziegler | vziegler_at_[hidden]
Software Engineer
think-cell Software GmbH | Chausseestr. 8/E | 10115 Berlin | Germany | phone +49 30 666473-10 | US phone +1 800 891 8091
Amtsgericht Berlin-Charlottenburg, HRB 85229 | European Union VAT Id DE813474306
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl

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