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

Changes between Version 3 and Version 4 of ForeachOnClassExample

Show
Ignore:
Author:
csauls (IP: 69.166.134.113)
Timestamp:
04/09/06 08:12:47 (15 years ago)
Comment:

Updated to use foreach type inference. I'm not sure if it works right with a class as the aggregate, so I left that one alone.

Legend:

Unmodified
Added
Removed
Modified
  • ForeachOnClassExample

    v3 v4  
    1919    int result = 0; 
    2020 
    21     foreach (size_t i, uint x; array) { 
     21    foreach (i, x; array) { 
    2222      result = dg(array[i]); 
    2323      if (result) 
    2929 
    3030void main () { 
    31   Foo a = new Foo()
     31  Foo a = new Foo
    3232 
    3333  a.array[0] = 73;