View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0027563 | Open CASCADE | OCCT:Foundation Classes | public | 2016-06-02 17:04 | 2016-12-09 16:38 |
| Reporter | kgv | Assigned To | bugmaster | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 7.0.0 | ||||
| Target Version | 7.1.0 | Fixed in Version | 7.1.0 | ||
| Summary | 0027563: Foundation Classes, opencascade::handle - make operator*() consistent with operator->() | ||||
| Description | While operator->() always return non-const pointer, operator*() returns const reference for const handle object:
//! STL-like cast to pointer to referred object
const T* get () const { return static_cast<const T*>(this->entity); }
//! STL-like cast to pointer to referred object
T* get () { return static_cast<T*>(this->entity); }
//! Member access operator (note non-const)
T* operator-> () const { return static_cast<T*>(this->entity); }
//! Dereferencing operator
T& operator* () { return *get(); }
//! Const dereferencing operator
const T& operator*() const { return *get(); }
Since OCCT does not yet support handles to constant object, it is better to provide consistent behavior for both accessors. Note that Handle declared for CDL have returned non-constant reference by operator*() within macros for derived classes, but not for Handle_Standard_Transient itself - I suppose the issue comes from here. This also leads to one more compilation issue on porting to OCCT 7.0.0 in rare cases. | ||||
| Steps To Reproduce |
void DoSomething (const Handle(OpenGl_Context)& theCtx)
{
OpenGl_Context& aCtx = *theCtx;
}
| ||||
| Tags | No tags attached. | ||||
| Test case number | Not needed | ||||
| related to | 0024023 | closed | Revamp the OCCT Handle |
|
|
Branch CR27563 has been created by kgv. SHA-1: 1bfb41ccc67095e58705d65c8a116fc2964ce0d2 Detailed log of new commits: Author: kgv Date: Sat Aug 6 14:07:54 2016 +0300 0027563: Foundation Classes, opencascade::handle - make operator*() consistent with operator->() |
|
|
Patch is ready for review. |
|
|
No remarks, please test |
|
|
Dear BugMaster, Branch CR27563 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode. SHA-1: 1bfb41ccc67095e58705d65c8a116fc2964ce0d2 Number of compiler warnings: occt component : Linux: 0 (0 on master) Windows: 0 (0 on master) MacOS : 0 (0 on master) products component : Linux: 64 (64 on master) Windows: 0 (0 on master) MacOS : 1149 Regressions/Differences/Improvements: No regressions/differences Testing cases: Not needed Testing on Linux: occt component : Total MEMORY difference: 89401299 / 88470102 [+1.05%] Total CPU difference: 19365.57 / 19248.95000000006 [+0.61%] products component : Total MEMORY difference: 30018525 / 30023278 [-0.02%] Total CPU difference: 5080.90999999998 / 5098.489999999977 [-0.34%] Testing on Windows: occt component : Total MEMORY difference: 57145984 / 57173794 [-0.05%] Total CPU difference: 18201.011072398873 / 18044.994472298804 [+0.86%] products component : Total MEMORY difference: 21271479 / 21236271 [+0.17%] Total CPU difference: 4890.100946599955 / 4792.459920699942 [+2.04%] There are no differences in images found by testdiff. |
|
|
Dear BugMaster, Branch CR27563 is TESTED. |
|
|
Branch CR27563 has been deleted by inv. SHA-1: 1bfb41ccc67095e58705d65c8a116fc2964ce0d2 |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2016-06-02 17:04 | kgv | New Issue | |
| 2016-06-02 17:04 | kgv | Assigned To | => abv |
| 2016-08-06 14:07 | kgv | Summary | Foundation Classes, opencascade::handle - operator*() should be consistent with operator->() => Foundation Classes, opencascade::handle - make operator*() consistent with operator->() |
| 2016-08-06 14:08 | git | Note Added: 0056524 | |
| 2016-08-06 14:08 | kgv | Note Added: 0056525 | |
| 2016-08-06 14:08 | kgv | Status | new => resolved |
| 2016-08-06 14:09 | kgv | Relationship added | related to 0024023 |
| 2016-08-08 11:47 |
|
Note Added: 0056542 | |
| 2016-08-08 11:47 |
|
Assigned To | abv => bugmaster |
| 2016-08-08 11:47 |
|
Status | resolved => reviewed |
| 2016-08-08 12:32 |
|
Assigned To | bugmaster => mkv |
| 2016-08-08 19:40 |
|
Note Added: 0056568 | |
| 2016-08-08 19:41 |
|
Note Added: 0056569 | |
| 2016-08-08 19:41 |
|
Assigned To | mkv => bugmaster |
| 2016-08-08 19:41 |
|
Status | reviewed => tested |
| 2016-08-08 19:41 |
|
Test case number | => Not needed |
| 2016-08-12 10:48 | bugmaster | Changeset attached | => occt master 9016c8bd |
| 2016-08-12 10:48 | bugmaster | Status | tested => verified |
| 2016-08-12 10:48 | bugmaster | Resolution | open => fixed |
| 2016-08-26 16:24 | git | Note Added: 0057156 | |
| 2016-12-09 16:31 |
|
Status | verified => closed |
| 2016-12-09 16:38 |
|
Fixed in Version | => 7.1.0 |