www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10564] New: Errors on the Template page of the language specification


           Summary: Errors on the Template page of the language
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: tommitissari hotmail.com

--- Comment #0 from Tommi <tommitissari hotmail.com> 2013-07-07 04:06:57 PDT ---
These are found on the page:

1) In the spec it says:

Even if template arguments are implicitly converted to the same template
parameter type, they still refer to different instances:

struct TFoo(int x) { }
static assert(is(TFoo!(3) == TFoo!(2 + 1))); // 3 and 2+1 are both 3 of type
static assert(!is(TFoo!(3) == TFoo!(3u)));   // 3u and 3 are different types

...but at least according to DMD, TFoo!(3) and TFoo!(3u) refer to the same

2) In the spec it says:

Template arguments not implicitly deduced can have default values:

void Foo(T, U=T*)(T t) { U p; ... }

int x;
Foo(&x);    // T is int, U is int*

...but the last line should be:
Foo(x);    // T is int, U is int*

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 07 2013