digitalmars.D - Suggestion: auto templates
- bobef (14/14) Feb 19 2006 It would be nice if there were something like auto templates. I.e. if we...
- Trevor Parscal (5/19) Feb 19 2006 This is a bit ambiguous in actual practice IMHO - but... I also can see ...
- bobef (2/28) Feb 19 2006 I mean the same way it is possible to write auto a=6;
- Hasan Aljudy (2/21) Feb 19 2006 is this the infamouse implicit template instantiation?
- bobef (2/24) Feb 19 2006 I don't know.
- nick (2/27) Feb 19 2006
- Sean Kelly (3/25) Feb 19 2006 Pretty much.
It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.
Feb 19 2006
In article <dt9fqs$1v1h$1 digitaldaemon.com>, bobef says...It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.This is a bit ambiguous in actual practice IMHO - but... I also can see how this would be awesome - when this ambiguity would be desired. Thanks, Trevor Parscal
Feb 19 2006
Trevor Parscal wrote:In article <dt9fqs$1v1h$1 digitaldaemon.com>, bobef says...I mean the same way it is possible to write auto a=6;It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.This is a bit ambiguous in actual practice IMHO - but... I also can see how this would be awesome - when this ambiguity would be desired. Thanks, Trevor Parscal
Feb 19 2006
bobef wrote:It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.is this the infamouse implicit template instantiation?
Feb 19 2006
Hasan Aljudy wrote:bobef wrote:I don't know.It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.is this the infamouse implicit template instantiation?
Feb 19 2006
It's a variation on it. bobef wrote:Hasan Aljudy wrote:bobef wrote:I don't know.It would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.is this the infamouse implicit template instantiation?
Feb 19 2006
Hasan Aljudy wrote:bobef wrote:Pretty much. SeanIt would be nice if there were something like auto templates. I.e. if we have something like: template mytemplate(_type) { int foo(_type[] ar); int boo(_type ar); } and type something like char[] a; foo(a); //or even mytemplate.boo(a[0]); DMD could autodetect the type and we won't need to specify the type every time manualy.is this the infamouse implicit template instantiation?
Feb 19 2006