Thread overview
[Issue 15038] Associative Array .get property const vs immutable
Mar 10, 2016
Jon Degenhardt
Mar 10, 2016
ZombineDev
Mar 10, 2016
ZombineDev
Dec 17, 2022
Iain Buclaw
March 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15038

Jon Degenhardt <jrdemail2000-dlang@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jrdemail2000-dlang@yahoo.co
                   |                            |m

--- Comment #1 from Jon Degenhardt <jrdemail2000-dlang@yahoo.com> ---
Some discussion in this thread: https://forum.dlang.org/post/mailman.206.1457557607.26339.digitalmars-d@puremagic.com

The summary is that there can be performance implications if it is necessary to copy a char[] to a string just to test for presence in the associative array. This can happen when streaming text from an input source, as it's natural to read as char[] (eg. File.byLine).

--
March 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15038

ZombineDev <petar.p.kirov@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |petar.p.kirov@gmail.com

--- Comment #2 from ZombineDev <petar.p.kirov@gmail.com> ---
While I agree that const should be as good as immutable in this case, sometimes
it is not so clear. For example, if the key type is immutable(char[])[], should
those be accepted:
1) immutable(char)[][]  (a.k.a. string[])
2) const(char)[][]
3) const(char[])[]

--
March 10, 2016
https://issues.dlang.org/show_bug.cgi?id=15038

--- Comment #3 from ZombineDev <petar.p.kirov@gmail.com> ---
BTW, http://dlang.org/phobos/std_exception#.assumeUnique can help in the mean time.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=15038

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=15038

--- Comment #4 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/17723

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--