#6212 closed Bugs (fixed)
"Method 3.1: Implement a Range Adaptor without arguments" does not implement
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The sample code in Method 3.1: Implement a Range Adaptor without arguments is incomplete; it does not provide for the syntax range | ::boost:: adaptors:: reversed
.
Change History (5)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 10 years ago
Replying to ne01026@…:
I wonder why the explicit assignment is needed? Or should it be a reference instead?
It should not be a reference (it would be a reference to a temporary which will have died long before one tries to use it).
Regarding why the explicit assignment is needed, see http://stackoverflow.com/questions/8092670/uninitialized-const. I believe
const detail::reverse_forwarder reversed = {};
also does the trick.
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 10 years ago
Fixed in trunk. The fix will appear in 1.53 (I will merge to release branch after 1.53 beta release).
Thanks for the report!
It turns out that the following code is needed to finish up:
I wonder why the explicit assignment is needed? Or should it be a reference instead?