brangdon@cix.co.uk (Dave Harris) wrote in message news:... > hyrosen@mail.com (Hyman Rosen) wrote (abridged): > > > Would you care to explain why "C++ is not safe because of > > > the STL"? > > He misphrased his English somewhat. He means that "just because C++ > > has the STL, that does not make it safe", alluding to the leagcy C > > stuff that is present. > Although the other meaning is true too. C++ is unsafe largely due to > undefined behaviour, and the STL has plenty of that. For example, > vec[-1]. Or resizing a container and invalidating an iterator:-). C++ is unsafe for any number of reasons. The STL just follows in the same old grand tradition. On the other hand, C++ gives the programmer an enormous freedom. Including the freedom to write very safe programs. I know of some other languages which make a lot of claims because one or two elements have a safer default (array accesses always bounds checked, for example), but which don't allow you any way of added to the safety built into the language. That doesn't mean C++ is perfect, of course. I'd rather have a language in which all of the defaults were fundamentally safe, but with the freedom to override them if you had special constraints, or even in cases where you came across a case which the language authors hadn't considered. I don't know such a language, however; it may exist somewhere, but if it does, it certainly isn't very popular or wide spread. -- James Kanze GABI Software mailto:kanze@gabi-soft.fr Conseils en informatique orientée objet/ Beratung in objektorientierter Datenverarbeitung 11 rue de Rambouillet, 78460 Chevreuse, France, Tél. : +33 (0)1 30 23 45 16 [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ] [ about comp.lang.c++.moderated. First time posters: do this! ]