Opened 10 years ago
Closed 9 years ago
#8483 closed Bugs (fixed)
Fix for reference type deduction in join_iterator.hpp
Reported by: | Owned by: | Nathan Ridge | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | join_iterator | Cc: |
Description
Changeset 70041 introduced a better reference type deduction for join_iterators (https://svn.boost.org/trac/boost/changeset/70041) that was originally proposed by my colleague aschoedl.
The deduction contains a bug however that (I think) the attached patch fixes
Attachments (1)
Change History (7)
by , 10 years ago
Attachment: | join_iterator_original.hpp.patch added |
---|
comment:1 by , 9 years ago
comment:2 by , 9 years ago
I'm sorry it took so long for me to respond. The problem is easy to replicate:
typedef boost::join_iterator< std::vector<int>::const_iterator, std::vector<int>::iterator > JoinIterator; static_assert( std::is_same< typename JoinIterator::reference, int const& >::value, "" );
The static_assert should not trigger but it does with the old implementation of join_iterator (using Visual Studio 2012). add_const< int& >::type is still int&. We need to remove the reference first, then add const then re-add the reference. (Or find an altogether better solution :-)
comment:3 by , 9 years ago
comment:5 by , 9 years ago
Owner: | changed from | to
---|
Hi Nathan! I see you have fixed this in the trunk. When you are happy would you please merge this to release and then close this ticket?
comment:6 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have already merged it to the 'master' branch in git: https://github.com/boostorg/range/commit/4c2898345972bd6c44c6b55abb386af931cc8fb5. I guess I need to close the bug manually now that we use git (with svn I would put "fixes #8483" in the commit message of the merge and it would auto-close the bug).
Could you please give an example of a piece of code that doesn't work as expected without this fix?
Thanks!