Handle vs SharedPointer #560
-
|
Hi, I would like to ask if I could use Shared Pointer from the C++ standard library instead of Handle? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
The difference between OpenCascade's Key differences:
If you want to use OCCT effectively, it's better to stick with You can still use |
Beta Was this translation helpful? Give feedback.

The difference between OpenCascade's
Handleand C++'sstd::shared_ptris similar to the difference betweenstd::shared_ptrandboost::intrusive_ptr.Key differences:
Intrusive vs. Non-intrusive Reference Counting:
Handle<T>is intrusive - the reference count is stored in the object itselfstd::shared_ptris non-intrusive - the reference count is stored separately from the objectObject Requirements:
Handle<T>requires objects to inherit fromStandard_Transientstd::shared_ptrcan wrap any objectMemory Layout:
Handle<T>has less overhead since the reference count is inside the objectstd::shared_ptrhas more overhead (typically two pointers - one to the object and one to the co…