Segmentation fault from using SList in a class?

Panke via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 6 12:01:27 PDT 2015


On Saturday, 6 June 2015 at 10:16:12 UTC, Tim K. wrote:
> On Saturday, 6 June 2015 at 10:10:15 UTC, Manfred Nowak wrote:
>> x is not initialized.
>>
>> `auto x= new Stack!(int);'
>> will do.
>
> Thank you two.
> But that leads me to another question: Why do I need to 
> initialize x with a "new Stack" but I don't need to initialize 
> p with a "new SList"?
>
> Best regards,
> Tim

Best way to construct a std.container is to use 
std.container.make.


More information about the Digitalmars-d-learn mailing list