Re: C++ Archeology: Limits of OO paradigm
On Feb 22, 6:57 pm, "Thomas J. Gritzan" <Phygon_ANTIS...@gmx.de>
wrote:
James Kanze wrote:
And either you have to
learn the actual details of the language better, or explain
yourself better, because from what I can understand, some of the
problems you site aren't problems---the operator new *is* an
atomic action, for example, which either succeeds or fails, and
if you write something like:
boost::shared_ptr< SomeType > p( new SomeType ) ;
there is no way memory can leak (provided the constructor of
SomeType is correctly written, of course).
I think he meant something like this:
typedef boost::shared_ptr<SomeTypeA> ptrA;
typedef boost::shared_ptr<SomeTypeB> ptrB;
some_function( ptrA(new SomeTypeA), ptrB(new SomeTypeB) );
The compiler could execute both 'new's, then construct the
smart pointers.
OK. So it's not so much an atomic new expression he wants, as
full ordering for expressions. I'm with him
there---independently of the wisdom of using such expressions
(and in this particular case, I think the use would be
reasonable if it worked), reproduceability is an important
feature for testing.
If this is the case, however, the words he used (atomic new)
were very poorly chosen.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34