|
Boost : |
Subject: Re: [boost] boost::adaptors::keys for mutable ranges of pairs
From: Michel Morin (mimomorin_at_[hidden])
Date: 2012-03-03 22:49:35
P-Stade Oven range library provides many useful range adaptors.
For your use case, you can use more generic `pstade::oven::elements_c<N>`
range range adaptor (or `pstade::oven::make_elements_c<N>`)
*boost::find_if(rng | pstade::oven::elements_c<0>(), pred) = val;
*boost::find_if(pstade::oven::make_elements_c<0>(rng), pred) = val;
Here is the documentation:
http://p-stade.sourceforge.net/oven/doc/html/oven/range_adaptors.html#oven.range_adaptors.elements_c
See also:
http://p-stade.sourceforge.net/oven/doc/html/oven/range_adaptors.html#oven.range_adaptors.elements
If you use clang and libc++, you might have a compile error due to the
incompatibility between the forward declaration and the inline namespace.
In that case, you can fix the problem by removing the forward declaration of
`std::pair` and adding `#include <utility>` in pstade/apple/pair_fwd.hpp.
Regards,
Michel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk