One Trick on shared_ptr

I find that shared_ptr can correctly handle the deconstruction of the sub-class without virtual deconstruntor. Therefore, I searched for related references and conducted one trial to verify it.
I do not want to go deep in the source code, so I just introduce them by some examples simply.
What’s more, I think up one optimizing trick after further study.

Continue reading

Opaque Structure

Opaque Structure is an essential concept, which has been widely applied to low-layer codes like Operate Systems. In this article, I will make a brief introduction to Handle and Opaque Structure, which are two closely related concepts. What’s more, I will present a tentative implement at the end.

Continue reading