Cannot instantiate a std.container.Array of a class with a init() function member.

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 2 19:35:45 PST 2015


On Mon, 02 Mar 2015 16:26:40 +0000, Meta wrote:

> On Monday, 2 March 2015 at 15:46:28 UTC, Francesco Cattoglio wrote:
>> Taken from
>> http://forum.dlang.org/thread/gjrbmskictrbcyeduqgu@forum.dlang.org
>>
>> trying to instantiate an Array!MyClass fails with a rather obscure
>> error message if the MyClass has a member function "void init()":
>>
>> http://dpaste.dzfl.pl/16d202b7124d
>>
>> Is this a std library bug, or should this be considered a mistake on
>> the library user side to name a member function "init"?
> 
> It's kind of ridiculous that the compiler doesn't complain about this,
> considering that defining an init member causes an error that you would
> have no idea how to fix unless you already knew about this issue.

standard policy: "D is only for smarts".
-------------- 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/20150303/f2de7732/attachment.sig>


More information about the Digitalmars-d mailing list