new DIP40: Template parameter deduction for constructors

Timothee Cour thelastmammoth at gmail.com
Thu May 16 02:12:39 PDT 2013


ok Hara Kenji just fixed the bug, see
https://github.com/D-Programming-Language/dmd/pull/2041

So what's left unspecified now wrt DIP40?

My proposal was to just address case C2 below, not C1 (at least initially):

case C1:
template A(T1) {struct A{  this()(T1 a) {} }}

case C2:
struct A(T1){     this()(T1 a) {}}

Even though struct A(T1) may internally be implemented as template A(T1), I
think the most useful / less problematic conversion is just case C2.
In other words, as i said before, the constructors inside a template (as in
case C1) would note be considered as part of the overload set for this
DIP40 (at least initially).


On Tue, May 14, 2013 at 12:02 PM, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 05/14/2013 05:08 PM, Kenji Hara wrote:
>
>> ...
>>
>>
>> Current dmd behavior is definitely a bug. Could you please file it in
>> bugzilla?
>> ...
>>
>
> http://d.puremagic.com/issues/**show_bug.cgi?id=10083<http://d.puremagic.com/issues/show_bug.cgi?id=10083>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130516/146c877c/attachment.html>


More information about the Digitalmars-d mailing list