ref_unwrapped.qbk 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. [/
  2. Copyright 2015 Robin Eckert
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. /]
  6. [section:ref_unwrapped ref_unwrapped]
  7. [table
  8. [[Syntax] [Code]]
  9. [[Pipe] [`rng | boost::adaptors::ref_unwrapped`]]
  10. [[Function] [`boost::adaptors::ref_unwrap(rng)`]]
  11. ]
  12. This adaptor produces a range than applies `.get()` on all values in
  13. the range. It is useful for iterating ranges of
  14. `std::reference_wrapper` values or values using similar semantics.
  15. The adaptor is C++11 (and above) only.
  16. * [*Precondition:] The `value_type` of the range has a `.get() const`.
  17. * [*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.
  18. * [*Range Category:] __single_pass_range__
  19. * [*Range Return Type:] `boost::unwrap_ref_range<decltype(rng)>`
  20. * [*Returned Range Category:] The range category of `rng`.
  21. [section:ref_unwrapped_example ref_unwrapped example]
  22. [import ../../../test/adaptor_test/ref_unwrapped_example.cpp]
  23. [ref_unwrapped_example]
  24. [endsect]
  25. This would produce the output `123`.
  26. [endsect]