Summary: Types can't be inferred from template argument types
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Magnus Lie Hetland <> 2011-03-28 14:40:38 
PDT ---
The following program fails for me (DMD 2.052):

import std.array, std.container;

template func(T) {
    alias void function(T) func;

void G(uint x) {

void f(T)(func!T g) { // Won't work, except with (*)
// void f(T)(void function(T) g) {

void main() {
    // f!uint(&G); // (*)

With the explicit "void function(T) g" in the argument specification, it works.
Or, if f!uint is specified explicitly. The problem seems to be inferring the
type T "through" the template func().

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to