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

Changes between Version 4 and Version 5 of AutoExample

Show
Ignore:
Author:
jcc7 (IP: 192.149.244.9)
Timestamp:
11/15/06 18:30:42 (15 years ago)
Comment:

updated

Legend:

Unmodified
Added
Removed
Modified
  • AutoExample

    v4 v5  
    55== Description == 
    66 
    7 Shows how auto objects differ from non-auto objects. 
     7Shows how auto objects differ from non-auto objects. Note how the auto objects are destroyed as soon as they go out of scope. ScopeExample shows the same result by using the new usage of the scope keyword. In the future, the auto keyword is expected to be limited to automatic type deduction. 
    88 
    99== Example == 
    1111{{{ 
    1212#!d 
    13 /* Demonstrates the usage of auto keyword. 
    14  * Note how the auto objects are destroyed as soon as they go out of scope. 
    15  */ 
    16  
    1713import std.stdio; 
    1814 
    5955}}} 
    6056 
     57== Sample Batch File == 
     58 
     59{{{ 
     60@echo off 
     61set pgm=AutoExample 
     62dmd %pgm%.d 
     63%pgm%.exe 
     64pause 
     65erase %pgm%.obj 
     66erase %pgm%.map 
     67}}} 
     68 
    6169== Output == 
    6270{{{ 
    7280main test destroyed 
    7381}}} 
     82 
     83== Compatibility == 
     84 * Tested with DMD 0.174 on Windows 2000. 
     85 * This usage of the auto keyword probably won't work in future versions of DMD (after DMD 0.174).