On 9/26/2014 4:02 AM, Paulo Pinto wrote:
On Friday, 26 September 2014 at 10:01:32 UTC, Ola Fosheim Grøstad wrote:
On Friday, 26 September 2014 at 09:41:09 UTC, Paulo Pinto wrote:
This is completely not true, we were using RAII in C++ before any compiler
had real support for exceptions.
Well, I haven't read the 1990 edition of the annotated C++ reference by
Stroustrup and Ellis since the mid 90s so my memory may be clouded, but that
is how I remember it.
And wikipedia says the same:
«The technique was developed for exception-safe resource management in C++[3]
during 1984–89»
http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization
I don't care what Wikipedia says, I was there in the early C++ days happily
using Turbo and Borland C++ in MS-DOS.
I wrote a C++ compiler in 1987. Nobody had ever heard of exceptions. Bjarne's
1986 "The C++ Programming Language" does not mention RAII or exceptions, but
does say on pg. 158:
"Calling constructors and destructors for static objects serves an extremely
important function in C++. It is the way to ensure proper initialization and
cleanup of data structures in libraries."