On Thursday, 15 January 2015 at 09:46:52 UTC, Szymon Gatner wrote:
On Tuesday, 13 January 2015 at 14:08:58 UTC, Adam D. Ruppe
Eh.. what exactly is incorrect? In C++ "MyClass c;"
stack-allocates the class assuming the default constructor is
there (unless of course this is a member declaration in an object
that's static or heap-allocated). In D it doesn't, it leaves you
with an unitialized reference type.
I've started writing a weekly D newsletter. Here's the first
issue, any feedback welcome!
In the future, I intend to have it written by Saturday for a
weekend release, so if you want something to appear this week,
please try to get it to by before then.
Fantastic inititive Adam, thanks for donating your time for
An issue I have tho:
// classes are reference types, so they must be
// initialized. "MyClass c;", unlike in C++, would
// leave c as null, causing a segfault when you try
// to use it.
That is not really true, is it? In C++ "MyClass c;" is actually
THE way to instantiate objects. I know you meant MyClass* but
as it is now it is just plain incorrect.