struct and default constructor

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 03:25:01 PDT 2014


On Fri, 10 Oct 2014 02:58:39 -0700
Walter Bright via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Default constructors are baked into C++. I can't escape the
> impression that the desire for D default constructors comes from more
> or less trying to write C++ style code in D.
second this. people also keep forgetting about default values and want
default constructors to simulate this:

  struct {
    int n = 42;
    string s = "default string";
  }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141010/c10fc6fa/attachment.sig>


More information about the Digitalmars-d mailing list