D - more or less power than C++?

xs0 xs0 at xs0.com
Fri Mar 3 18:26:46 PST 2006


Walter Bright wrote:
> "Oskar Linde" <olREM at OVEnada.kth.se> wrote in message 
> news:duak88$1rmh$1 at digitaldaemon.com...
> 
>>- Definable assignment/copy semantics for structs.
>>
>>This (combined with end of scope destruction) allows automatic reference
>>counted resource handles, ownership-transferals, and more.
> 
> 
> True, but the need for these are relatively insignificant in D, since D has 
> gc and on_scope. 

Hmm, are there any major use cases for assignment/copy semantics for 
structs, other than smart pointers? If not, the solution may be to 
support those explicitly, and be done with it?

Having weak references/pointers would be useful in itself (where weak 
means it does not prevent GC; of course it should be detectable whether 
the object is still there). Those, GC, auto and added support for 
something like shared_ptr and auto_ptr would cover most needs, I think?

As for the original question, I think D is way better.


xs0



More information about the Digitalmars-d mailing list