Opened 8 years ago
Last modified 8 years ago
#10789 new Bugs
unexpected behaviour with boost range join on rvalue
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.57.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I'm trying to append one element to a range, and iterate over the resulting compound range. When the rhs of the join
is an lvalue, everything seems ok. However, when the rhs of the join
is an rvalue, I'm seeing something unexpected.
Specifically, when such a joined range is accessed directly by a for(auto e : range)
loop, or when it is saved in a variable using auto
, then iterated over, the singleton in the second container is not produced correctly. If however the joined range is passed by reference (other than non-const lvalue, obviously), then iterated over, the result is correct.
I'm using
gcc-4.8.2
andclang-3.5
. I'm compiling with:The results I'm seeing are either "12 34", which is ok, or "12 0", which is not ok. Note that the last element is not even default constructed (which would be 99, not 0).