View Issue Details

IDProjectCategoryView StatusLast Update
0027571Open CASCADEOCCT:Foundation Classespublic2021-11-01 18:11
Reporteragv Assigned Toabv  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
PlatformWindowsOSVC++ 2013 
Product Version7.0.0 
Target Version7.7.0 
Summary0027571: Foundation Classes - bad implementation of NCollection_Sequence::Iterator in reversed mode
DescriptionRegression after 0024831 "Make iterators of NCollection classes STL-compatible".

When the Iterator is initialized for reverse iteration (isStart==False) then it is placed to empty position beyond the end of collection. The OCCT loop semantics requires that an iterator after creation should point to the first iterated item, as it was implemented before version 6.8.0

I propose to restore the original definition of method NCollection_BaseSequence::Iterator::Init() and then revise the STL methods of NCollection_Sequence, particularly now end() and cend() likely lead to crash.
Steps To Reproducetest bugs fclasses bug27571
TagsNo tags attached.
Test case number

Relationships

related to 0024831 closedapn Open CASCADE Make iterators of NCollection classes STL-compatible 

Activities

git

2016-09-28 19:32

administrator   ~0058286

Branch CR27571 has been created by ski.

SHA-1: 48c6f7b63627de2828e6e5333daa86c1236e0a54


Detailed log of new commits:

Author: ski
Date: Wed Sep 28 17:13:47 2016 +0300

    0027571: Bad implementation of NCollection_Sequence::Iterator
    
    Reverse iterator after creation points to the first iterated item now (last item of sequence).
    Test case was created.

git

2016-09-29 13:23

administrator   ~0058314

Branch CR27571 has been updated forcibly by ski.

SHA-1: 52bb4675a9f9c381f290c6831c7df99d7f7da5f1

ski

2016-09-29 15:12

developer   ~0058321

Dear abv,

all changes are located in branch CR27571.

When the Iterator is initialized for reverse iteration (isStart==False) then it
points to the first iterated item of reversed sequence.
For example:
sequence = 1 2 3 4 5
reversed sequence = 5 4 3 2 1
so, reversed iterator will point to the item 5 after initialization.

It is possible to use Next() with reversed iterator, it will set iterator to the next item 5 -> 4.
More() is also usable.
Previous() will reset iterator to the previous item 4 -> 5.

Methods rbegin()/rend(), increment / decrement operators can be used to work with reversed iterator too.

Test case bugs fclasses bug27571 was created.

Please, review.

Issue History

Date Modified Username Field Change
2016-06-06 16:29 agv New Issue
2016-06-06 16:29 agv Assigned To => abv
2016-09-23 12:20 abv Assigned To abv => ski
2016-09-23 12:20 abv Status new => assigned
2016-09-28 19:32 git Note Added: 0058286
2016-09-28 19:37 kgv Relationship added related to 0024831
2016-09-29 13:23 git Note Added: 0058314
2016-09-29 14:01 kgv Summary Bad implementation of NCollection_Sequence::Iterator => Foundation Classes - bad implementation of NCollection_Sequence::Iterator in reversed mode
2016-09-29 15:12 ski Note Added: 0058321
2016-09-29 15:12 ski Assigned To ski => abv
2016-09-29 15:12 ski Status assigned => resolved
2016-09-29 15:12 ski Steps to Reproduce Updated
2016-11-22 12:25 abv Target Version 7.1.0 => 7.2.0
2017-08-29 09:37 abv Target Version 7.2.0 => 7.3.0
2018-05-12 21:36 abv Target Version 7.3.0 => 7.4.0
2019-09-04 22:12 abv Target Version 7.4.0 => 7.5.0
2020-10-26 14:33 utverdov Target Version 7.5.0 => 7.6.0
2021-11-01 18:11 szy Target Version 7.6.0 => 7.7.0