Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 1746

Show
Ignore:
Timestamp:
07/12/10 00:46:16 (14 years ago)
Author:
andrei
Message:

Removed put for arrays

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phobos/std/array.d

    r1744 r1746  
    434434    { 
    435435        n -= 4; 
    436436        return decode(a, n); 
    437437    } 
    438438    else 
    439439    { 
    440440        throw new UtfException("Invalid UTF character at end of string"); 
    441441    } 
    442442} 
    443443 
    444  
    445 /* 
    446 Implements the range interface primitive $(D put) for built-in 
    447 arrays. Due to the fact that nonmember functions can be called with 
    448 the first argument using the dot notation, $(D array.put(e)) is 
    449 equivalent to $(D put(array, e)). 
    450  
    451 Example: 
    452 ---- 
    453 void main() 
    454 { 
    455     int[] a = [ 1, 2, 3 ]; 
    456     int[] b = a; 
    457     a.put(5); 
    458     assert(a == [ 2, 3 ]); 
    459     assert(b == [ 5, 2, 3 ]); 
    460 } 
    461 ---- 
    462 */ 
    463 alias std.range.put put; 
    464  //void put(T, E)(ref T[] a, E e) { assert(a.length); a[0] = e; a = a[1 .. $]; } 
    465  
    466444// overlap 
    467445/* 
    468446Returns the overlapping portion, if any, of two arrays. Unlike $(D 
    469447equal), $(D overlap) only compares the pointers in the ranges, not the 
    470448values referred by them. If $(D r1) and $(D r2) have an overlapping 
    471449slice, returns that slice. Otherwise, returns the null slice. 
    472450 
    473451Example: 
    474452---- 
    475453int[] a = [ 10, 11, 12, 13, 14 ];