Skip to content

Commit e8c849a

Browse files
committed
Allow the result of concatenating two ranges to be moved from
1 parent ab478f3 commit e8c849a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/util/range.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ struct concat_iteratort
244244
return tmp;
245245
}
246246

247+
value_type &operator*()
248+
{
249+
if(first_begin == first_end)
250+
return *second_begin;
251+
return *first_begin;
252+
}
253+
254+
value_type *operator->()
255+
{
256+
if(first_begin == first_end)
257+
return &(*second_begin);
258+
return &(*first_begin);
259+
}
260+
247261
const value_type &operator*() const
248262
{
249263
if(first_begin == first_end)

0 commit comments

Comments
 (0)