I&#x27;m not a C++ expert, RAII sounds to me is like a synchronous GC in C++ -- resource auto alloc and dealloc by it&#x27;s lifetime (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Resource_Acquisition_Is_Initialization" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Resource_Acquisition_Is_Initia...</a>), correct me if I am wrong.<p>Java, in another way, it has an asynchronous GC -- use different generations, and not release object right away just because out of scope.<p>Anyway, I am saying &#x27;like C++&#x27;, I meant the possible way C++ can manually manage the memory directly, learnt from what you mentioned, I should say: &#x27;like C&#x27;. Thanks.