Not quite. You'll note that I am creating the elements in the
associative array, not just iterating over them; some of them
just happen to be duplicates. FWIW: That foreach happens to be
over an input stream.
On Wednesday, 1 April 2015 at 03:11:58 UTC, Mark Isaacson wrote:
I'm presently trying to create the value of a key in an
associative array if it does not exist, and then maintain a
reference/pointer to the value. This is what I came up with,
but it seems really crufty and I feel that there must
I'm presently trying to create the value of a key in an
associative array if it does not exist, and then maintain a
reference/pointer to the value. This is what I came up with, but
it seems really crufty and I feel that there must be a cleaner
way:
Value[string] assocArray;
foreach (...) {