Archived issue #0026549
Provide move constructors and operators for basic classes
Description
C++11 introduces notion of rvalue references which can be used to avoid unnecessary copying of temporary objects, see http://www.artima.com/cppsource/rvalue.html
Rvalue references are supported by VC++ 10 and above, and by GCC 4.3 and above, thus they can be used in modern OCCT (since #0024023).
The first candidates for this improvement are Handles and collections.
Rvalue references are supported by VC++ 10 and above, and by GCC 4.3 and above, thus they can be used in modern OCCT (since #0024023).
The first candidates for this improvement are Handles and collections.
Public activity
6 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Aug 11 23:01:05 2015 +0300
0026549: Provide move constructors and operators for basic classes
Move constructor and operator added for opencascade::handle<>
[revision removed]
Detailed log of new commits:
Author: Author
Date: Tue Aug 11 23:01:05 2015 +0300
0026549: Provide move constructors and operators for basic classes
Move constructor and operator added for opencascade::handle<>
First version is pushed to CR26549. It provides move semantics for Handles. Though it does not give noticeable change in performance in tests, it reduces number of calls to Standard_Transient::IncrementRefCounter() methods of Handle, and thus is potentially useful (especially in multithreaded programs, as each call sets a lock).
The measured numbers of calls are:
| Operation | master | CR26549 |
|----------------------------------|
| DRAW start | 4075 | 4075 |
| pload ALL | 137767 | 128967 |
| bottle.tcl | 30749697 | 30440160 |
The measured numbers of calls are:
| Operation | master | CR26549 |
|----------------------------------|
| DRAW start | 4075 | 4075 |
| pload ALL | 137767 | 128967 |
| bottle.tcl | 30749697 | 30440160 |
Other classes for which move semantics would be useful are vector and matrix classes from math package.
Related modification within CR27111_6 has been reviewed without remarks.
Should be tested in scope of #0027111.
Should be tested in scope of #0027111.
Tested in framework of branch CR27111_6
Branch [archived branch] has been deleted by Commenter 2.
[revision removed]
[revision removed]
Related records