[Issue 4483] Make foreach over string or wstring where element type not specified a warning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 20 05:30:58 PDT 2010


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


Max <awishformore at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |awishformore at gmail.com


--- Comment #1 from Max <awishformore at gmail.com> 2010-07-20 05:30:51 PDT ---
I agree.

I'm absolutely happy with the way D handles foreach loops on strings and
char[].

However, disambiguation of foreach loops for char and wchar is a an issue that
should be addressed. I think the best solution would be to mave it the coding
standard to specify the char/dchar/wchar.

Issuing a warning whenever you iterate over a string or dstring without
explicitely declaring char/char/wchar would indeed be the way to do so. The
user is still free to ignore the warning, but accidental misuse would be
avoided and a consistently clear coding style would be encouraged.

-- 
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