Page MenuHomePhabricator

ikelarev (Ivan Kelarev)
User

Projects

User does not belong to any projects.

User Details

User Since
May 11 2020, 12:53 PM (8 w, 17 h)

Recent Activity

May 18 2020

ikelarev added a comment to D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

Boost documentation says the same: "If Reference is use_default then the reference member of transform_iterator is result_of<const UnaryFunction(iterator_traits<Iterator>::reference)>::type. Otherwise, reference is Reference" (https://www.boost.org/doc/libs/1_73_0/libs/iterator/doc/transform_iterator.html).

May 18 2020, 9:39 AM · Restricted Project

May 15 2020

ikelarev added a comment to D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

@dblaikie
Yes, David, you are right. reverse_iterator should not be used with such implementation. Talking about boost implementation I noticed this thing:

May 15 2020, 6:29 PM · Restricted Project
ikelarev added a comment to D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

Any chance you've looked into prior art (I assume Boost has something like this) with regards to when/how often the functor should be called?

May 15 2020, 12:31 PM · Restricted Project

May 14 2020

ikelarev added a comment to D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

@dblaikie
Hi David! I've implemented the class as two specializations of the template and added a test, could you please take a look?

May 14 2020, 9:13 PM · Restricted Project

May 12 2020

ikelarev updated the diff for D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..
May 12 2020, 6:52 PM · Restricted Project
ikelarev updated the diff for D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

Thanks, David, I believe I see your point. I added a separated implementation of mapped_iterator for the case when functor returns non-reference value. As a reference implementation I used existing pointer_iterator class, which has mutable Ptr member updated in operator*() call.

May 12 2020, 10:44 AM · Restricted Project

May 11 2020

ikelarev updated the summary of D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..
May 11 2020, 4:44 PM · Restricted Project
ikelarev updated the diff for D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

David, I agree with you regarding the pointer type, it really seems incorrect too. I modified my patch to replace it with FuncReturnTy as well.

May 11 2020, 4:44 PM · Restricted Project
ikelarev added a comment to D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..

David, thank you for your comments! Actually I didn't try to change pointer type and difference type of the iterator, I left them exactly equal to default values of iterator_adaptor_base. I just wanted to fix reference type of the iterator. I added another example (without map_range/reverse) to make clearer what I mean. Shouldn't operator* return exactly iterator's reference type here?

May 11 2020, 4:12 PM · Restricted Project
ikelarev updated the summary of D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..
May 11 2020, 4:12 PM · Restricted Project
ikelarev updated the diff for D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..
May 11 2020, 3:07 PM · Restricted Project
ikelarev created D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value..
May 11 2020, 1:28 PM · Restricted Project