digitalmars.D.bugs - [Issue 6322] New: IFTI doesn't support static arrays
- d-bugmail puremagic.com (29/29) Jul 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6322
- d-bugmail puremagic.com (13/13) Jul 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6322
- d-bugmail puremagic.com (8/8) Jul 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6322
- d-bugmail puremagic.com (16/24) Apr 08 2013 http://d.puremagic.com/issues/show_bug.cgi?id=6322
http://d.puremagic.com/issues/show_bug.cgi?id=6322 Summary: IFTI doesn't support static arrays Product: D Version: D1 & D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: verylonglogin.reg gmail.com --- Maybe it duplicates some other issue, but I didn't find it. Or maybe it is issue 2296. void f(T: T[n], size_t n)(T[n] t) { } void main() { int[2] a; f!(typeof(a))(a); //this compiles f(a); //this doesn't } main.d(7): Error: template main.f(T : T[n],uint n) does not match any function template declaration main.d(7): Error: template main.f(T : T[n],uint n) cannot deduce template function from argument types !()(int[2u]) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6322 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid CC| |yebblies gmail.com Platform|Other |All OS/Version|Windows |All void f(T: U[n], U, size_t n)(T t) { } works as a substitute. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6322 --- Another workaround is D2 constraints (more powerful and less buggly): import std.traits; void f(Tn)(Tn t) if(isStaticArray!Tn) { } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6322 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALIDvoid f(T: T[n], size_t n)(T[n] t) { } void main() { int[2] a; f!(typeof(a))(a); //this compiles f(a); //this doesn't }The template function never called with IFTI, because: 1. T is deduced to int from the argument 'a'. 2. T is tested with specialized signature `: T[n]`. But T is int, so never match. Although it looks weird behavior, it is not a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 08 2013