1234567891011121314151617181920212223242526272829303132 |
- [/
- Copyright 2015 Robin Eckert
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- /]
- [section:ref_unwrapped ref_unwrapped]
- [table
- [[Syntax] [Code]]
- [[Pipe] [`rng | boost::adaptors::ref_unwrapped`]]
- [[Function] [`boost::adaptors::ref_unwrap(rng)`]]
- ]
- This adaptor produces a range than applies `.get()` on all values in
- the range. It is useful for iterating ranges of
- `std::reference_wrapper` values or values using similar semantics.
- The adaptor is C++11 (and above) only.
- * [*Precondition:] The `value_type` of the range has a `.get() const`.
- * [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `y.get()` where `y` is the corresponding element in the original range.
- * [*Range Category:] __single_pass_range__
- * [*Range Return Type:] `boost::unwrap_ref_range<decltype(rng)>`
- * [*Returned Range Category:] The range category of `rng`.
- [section:ref_unwrapped_example ref_unwrapped example]
- [import ../../../test/adaptor_test/ref_unwrapped_example.cpp]
- [ref_unwrapped_example]
- [endsect]
- This would produce the output `123`.
- [endsect]
|