Archived issue #0023919
Redefine operator* to Handle_Standard_{Transient|Persistent} subclasses
Description
The operator* is now to be redefined in subclasses helping to reduce the code as follows:
void Standard_HandleTest::Ref()
{
Handle(MMgt_TShared) aH = new MMgt_TShared;
#if 1
MMgt_TShared& aR = *aH;
#else
MMgt_TShared& aR = *(aH.operator->());
#endif
}
This also makes OCC handle more compliant with NCollection_Handle and std::shared_ptr.
void Standard_HandleTest::Ref()
{
Handle(MMgt_TShared) aH = new MMgt_TShared;
#if 1
MMgt_TShared& aR = *aH;
#else
MMgt_TShared& aR = *(aH.operator->());
#endif
}
This also makes OCC handle more compliant with NCollection_Handle and std::shared_ptr.
Steps to reproduce
Compile the code snippet given in the description.
Public activity
3 archived notes
Participants are labeled by their role within this record.
Fix pushed into git repository
No remarks, please test
Dear Commenter 3,
Branch CR23919 (and products from GIT master) was compiled on Linux and Windows platforms and tested with rebase.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 366386144 / 366591836
Total CPU difference: 44237.570000001346 / 54395.14000000041
Testing on Windows:
Total MEMORY difference: 418521512 / 418944196
Total CPU difference: 32915.234375 / 33369.984375
There are not serious differences in images found by testdiff.
Branch CR23919 (and products from GIT master) was compiled on Linux and Windows platforms and tested with rebase.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 2 (2 on master)
Windows: 11 (11 on master)
products component :
Linux: 0 (0 on master)
Windows: 64 (64 on master)
Regressions:
No regressions
Improvements:
No improvements
Testing cases:
Not needed
Testing on Linux:
Total MEMORY difference: 366386144 / 366591836
Total CPU difference: 44237.570000001346 / 54395.14000000041
Testing on Windows:
Total MEMORY difference: 418521512 / 418944196
Total CPU difference: 32915.234375 / 33369.984375
There are not serious differences in images found by testdiff.