<div dir="ltr"><div>What would be a good answer to this article?</div><a href="http://swiftcoder.wordpress.com/2009/02/18/raii-why-is-it-unique-to-c/" target="_blank">http://swiftcoder.wordpress.com/2009/02/18/raii-why-is-it-unique-to-c/</a><br>
<div><br></div><div>Especially the part mentioning D:{</div><div>D’s scope keyword, Python’s with statement and C#’s using declaration all provide limited RAII, by allowing resources to have a scoped lifetime, but none of them readily or cleanly support the clever tricks allowed by C++’s combination of smart pointers and RAII, such as returning handles from functions, multiple handles in the same scope, or handles held by multiple clients.<br>
</div><div>}</div><div><br></div><div>This morning I was pointing to some deprecated usage of scope mentioned in docs (EMAIL:scope classes mentioned in tutorials, but deprecated). The pull request (<a href="https://github.com/D-Programming-Language/dlang.org/pull/637/files">https://github.com/D-Programming-Language/dlang.org/pull/637/files</a>) mentions using struct or classes allocated on the stack via typecons.scoped. However what about the RAII usage mentioned in the above article that allows C++ to return handles for eg (impossible via scope), that get deterministically destroyed?</div>
<div><br></div><div><br></div></div>