www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2782] New: Parameter Names Should Be Visible In Function Template Constraints

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2782

           Summary: Parameter Names Should Be Visible In Function Template
                    Constraints
           Product: D
           Version: 2.016
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dsimcha yahoo.com


void doStuff(T)(T arg)
if(is(typeof(arg))) {
}

void main() {
    doStuff(1);
}

Results:

test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) does not match any
function template declaration|
test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) cannot deduce
template function from argument types !()(int)

I assume the reason this does not compile is because the symbol arg is not
visible from the template constraint.


-- 
Apr 01 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2782


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 22 2009