[Issue 6659] Destructor in range foreach called after initialization

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 23 05:52:12 PDT 2012


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Platform|Other                       |All
         OS/Version|FreeBSD                     |All
           Severity|normal                      |major


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2012-03-23 05:52:32 PDT ---
A foreach range statement:

foreach (iter; lower .. upper) {}

is always translated to a for statement:

for (auto iter = lower, limit = upper; iter != upper; ++iter) {}

So, this is a lifetime issue declared in for statement Initialize part.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list