======================================================================
5/8/93
Notes on use of *new to create objects
to be placed in collections.
======================================================================
Below, you'll find diff output indicating
changes involving use of new to allocate
elements on the heap instead of the stack.  
These changes were required to eliminate bugs
in the MSC version.  BC++ handled them
ok.  These differences point out the
different way that the two compilers 
deal with temporary objects used for
intermediate calculations in expressions.
Borland gives each temporary a unique memory
location on the stack.  MSC reuses the
same memory location over once the expression
involving the creation of the temporary
has been executed.

It's unclear whether or not it should 
be possible to add elements created
as temporaries on the local stack to a 
collection.  It's less readable and more
wordy to use *new.  It's also safer.  To
insure portability, use *new to allocate
objects on the heap when creating them
and adding them to a collection in a
single statement.
======================================================================
Diff output:
======================================================================
dtlibv/xidentdi.cpp c:/usr/src/dtl/dtlibv/xidentdi.cpp
======================================================================
14,15 c 14,15
<     d.add(*new AssocInt(a,1));
<     d.add(*new Assoc(b, *new Point(2,2)));
>     d.add(AssocInt(a,1));
>     d.add(Assoc(b,Point(2,2)));
21 c 21
<     d.atKey(a, *new Integer(0));
>     d.atKey(a,Integer(0));
======================================================================
dtlibv/xordcltn.cpp c:/usr/src/dtl/dtlibv/xordcltn.cpp
======================================================================
21,22 c 21,22
<     b.addAfter(Point(1,2),   *new Point(1,21));
<     b.addBefore(Point(1,2),  *new Point(1,19));
>     b.addAfter(Point(1,2),Point(1,21));
>     b.addBefore(Point(1,2),Point(1,19));
======================================================================


======================================================================
Diff output for directory: dt/jul93
======================================================================
diff dict1.cpp changes/dict1.cpp
======================================================================
10 c 10
<     aDictionary.add(
>     aDictionary.add(*new
13 c 13
<     aDictionary.add(
>     aDictionary.add(*new
16 c 16
<     aDictionary.add(
>     aDictionary.add(*new
19 c 19
<     aDictionary.add(
>     aDictionary.add(*new
======================================================================
diff dict3.cpp changes/dict3.cpp
======================================================================
32 c 32
<     aDictionary.addAssoc((*new String("key2")), Integer(2));
>     aDictionary.addAssoc((*new String("key2")), *new Integer(2));
34 c 34
<
>
36,38 c 36,38
<     aDictionary.addAssoc((*new String("x")), Integer(100));
<     aDictionary.addAssoc((*new String("y")), Integer( 45));
<
>     aDictionary.addAssoc((*new String("x")), *new Integer(100));
>     aDictionary.addAssoc((*new String("y")), *new Integer( 45));
>
51 c 51
<     aDictionary.atKey(String("y"), Integer(46));
>     aDictionary.atKey(String("y"), *new Integer(46));
======================================================================

