[Issue 610] New: Undocumented behaviour: ~ and ~= can now concatenate an array with a single element

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 27 07:48:44 PST 2006


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

           Summary: Undocumented behaviour: ~ and ~= can now concatenate an
                    array with a single element
           Product: D
           Version: 0.175
          Platform: All
               URL: http://www.digitalmars.com/d/expression.html
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: smjg at iname.com
 BugsThisDependsOn: 511


Once upon a time, both sides of a ~ had to be arrays of the same type, even
though ~= allowed the rvalue to be a single element to be apppended to an
array.

Now, ~ can also take a single element on one side.  For example:

----------
int[] qwert = [ 2, 3, 4, 5, 6 ];
int[] yuiop = qwert ~ 8;
int[] asdfg = 10 ~ yuiop;
----------

However, this capability is not documented, either for ~ or for ~=, as far as I
can see.


-- 




More information about the Digitalmars-d-bugs mailing list