Bug?: Presence of "init()" Method Causes std.array.appender to Fail to Compile

Uknown sireeshkodali1 at gmail.com
Mon May 14 00:04:20 UTC 2018


On Sunday, 13 May 2018 at 23:53:58 UTC, Vijay Nayar wrote:
> I encountered a very unexpected error when working on a 
> project.  It seems that the Appender and RefAppender structs 
> created from the std.array.appender() method are sensitive to 
> the mere presence of a method called "init()" on the element 
> type of the array.
>
> [...]

init is a reserved function. T.init is the initial value for a 
type. int.init is 0 and float.init is NaN. Try changing your 
function name to initialise or something like that.


More information about the Digitalmars-d mailing list