Walter: Before you go and implement the new RAII syntax..

Gregor Richards Richards at codu.org
Fri Sep 29 08:33:22 PDT 2006


I hate to dredge up an old post, but I was just thinking about this and 
thought I'd point out one thing to anyone listening:

RAII stands for Resource Allocation Is Initialization.  You can do RAII 
without automatically-deleted classes, it's just difficult.  For this 
reason, a keyword 'raii' would be inappropriate - what's being described 
is NOT RAII, it's just an incidental change that makes RAII more useful. 
  RDID (Resource Deallocation Is Destruction) is closer to what's being 
described, but still not spot-on: that has to do with the class 
definition, not the actual use of the class.  What's being described is 
simply an object associated with a scope.  In short: the changes 
described have nothing to do with RAII, they just make it more useful, 
so having a keyword 'raii' is nonsense.

If I see a keyword 'raii' meaning anything like this at any point in the 
future, I'll be crying myself to sleep that night :P

Just my 2¢

  - Gregor Richards



More information about the Digitalmars-d mailing list