www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10033] New: Wrong example in chapter Vector Extensions


           Summary: Wrong example in chapter Vector Extensions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: kai redstar.de

--- Comment #0 from kai redstar.de 2013-05-05 11:23:50 PDT ---
In the Language Reference, chapter Vector Extensions, section Accessing
Individual Vector Elements:

The 3rd example

cast(int[4])v[3] = 2;

does not compile. You have to add parenthesis to compile:

(cast(int[4])v)[3] = 2;

(According to TDPL, [] has a higher precedence then cast(). The compile error
is therefore correct.)

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