Languages for servers (Go, D, and more)
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 7 19:31:49 PDT 2014
On Monday, 7 July 2014 at 18:15:32 UTC, Sean Kelly wrote:
> On Saturday, 5 July 2014 at 06:43:31 UTC, Russel Winder via
> Digitalmars-d wrote:
>> On Fri, 2014-07-04 at 20:25 +0000, Chris Cain via
>> Digitalmars-d wrote:
>> […]
>>> 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.
>> […]
>>
>> All the C++ folk are saying that with C++14 is you are using
>> any heap at
>> all you are more than likely doing it wrong. Modern C++ idiom
>> is for completely new/delete free code.
>
> With asynchronous event-driven code (ie. server code), I don't
> see any way to avoid all use of new / delete.
std::make_unique and std::make_shared are what you're "supposed"
to use. The new and delete operators are (usually) for library
writers.
Even before C++11, using delete was frowned upon but necessary
with containers of pointers due to std::auto_ptr not helping.
Well, that and the lack of move semantics.
Atila
More information about the Digitalmars-d
mailing list