3 ms·
> You could write a RAII implementation in terms of defer but not the other way around. c'mon, here's the article from 2000 that introduces ScopeGuard : https:
by jcelerier 6y ago
> You could write a RAII implementation in terms of defer but not the other way around.
c'mon, here's the article from 2000 that introduces ScopeGuard : https://www.drdobbs.com/cpp/generic-change-the-way-you-write-excepti/184403758?pgno=2 https://www.drdobbs.com/cpp/generic-change-the-way-you-write...
- gpderetta 6y agoRight! And to be clear you cannot implement RAII in term of defer as RAII is lifetime based while defer is only scope based.