Languages for servers (Go, D, and more)

Remo via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 4 14:09:03 PDT 2014


On Friday, 4 July 2014 at 20:43:01 UTC, Dicebot wrote:
> On Friday, 4 July 2014 at 20:25:24 UTC, Chris Cain wrote:
>> On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
>>> Who want to use C-style memory management today ?
>>> How about C++ style memory management, is this easy to this 
>>> in D2
>>> now ?
>>
>> The big problem with that is "C++ style memory management" 
>> implies we're going to have new/delete which AFAIK delete is 
>> depreciated and new is currently hardcoded to use the GC.
>
> It does not matter at all - new/delete does not have anything 
> that malloc/free don't give you. What does matter is that RAII 
> does not fit will with some of language feature - for example, 
> structs are not polymorphic so wrapping class into struct for 
> RAII removes any polymorphic traits from it.

By "C++ style memory management" I do not mean naked new/delete 
or malloc/free.
What I mean is RAII, smart pointers and destructor's.
What is the proper replacement for std::unique_ptr and 
std::shared_ptr in D2 ?
Of course with move support for unique_ptr :)


More information about the Digitalmars-d mailing list