www.digitalmars.com         C & C++   DMDScript  

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

http://d.puremagic.com/issues/show_bug.cgi?id=10564

           Summary: Errors on the Template page of the language
                    specification
           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:
http://dlang.org/template.html

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
int
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
type.


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