Why structs and classes instanciations are made differently ?

Houdini via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 26 02:54:39 PDT 2017


On Tuesday, 25 July 2017 at 17:16:00 UTC, Kagamin wrote:
> On Tuesday, 25 July 2017 at 15:56:45 UTC, Houdini wrote:
>> Yes, but it isn't the default way in C++ to do dynamic 
>> instanciation.
>
> https://github.com/isocpp/CppCoreGuidelines this? It's only 2 
> years old. The new operator predates it by decades.

I meant :

When you need to instantiate a class, you usually do :

MyClass a;

and not :

MyClass* a = new MyClass();

You're in a value model.

If you find anything in Cpp Guidelines against that, I am 
interested.


More information about the Digitalmars-d-learn mailing list