Now, a critic of Stroustrup's choices

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 17 03:59:38 PDT 2014


On Wednesday, 17 September 2014 at 09:21:13 UTC, eles wrote:
>
> But, OTOH, maybe it is a confusion in my head that comes from 
> the fact that "constructing" an object means both allocating 
> and constructing, while "destructing" means both deallocating 
> and destructing.

It usually is. I'm not sure what you are talking about. Most 
containers in C++ (and D) first allocate with an allocator, and 
then placement construct.

> I sometimes just feel that construction/destruction shall be 
> separated form allocation/deallocation.

Again, it usually is. AFAIK, the only thing is "vanilla new", 
which conveniently does both for you in a single convenient call. 
If you want to do *anything* else, then you have to manage both 
individually.


More information about the Digitalmars-d mailing list