foreach overloading

Morlan home at valentimex.com
Sun Apr 3 23:58:45 PDT 2011


The section 12.9 (page 380) in the TDPL books presents foreach overloading. However the example shown is problematic because there is no
method of automatic initializing of the _root variable without which foreach overloading cannot work properly (obviously the loop steering
variable has to be initialized each time the loop is created). I tried to consult the language reference but the section devoted to
operator overloading does not have any information about foreach overloading. Where can I find definitive information about this feature?
What is the reason for discrepancy between TDPL book and the web language reference?


More information about the Digitalmars-d mailing list