Bug 13637 – std.utf.decode: index parameter should be able to pass by value

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-19T11:24:00Z
Last change time
2016-09-07T15:11:16Z
Assigned to
nobody
Creator
neuranuz

Comments

Comment #0 by neuranuz — 2014-10-19T11:24:12Z
Is it reasonable to pass everywhere when it's possible by *ref* to function even integers? This goes to very stupid bugs. If ref is neded there (but I think it is not) we could use *auto ref* instead for those cases where it's not possible get address of parameter or something else. The above example doesn't compiles because we can't get *ref* for 0 literal import std.stdio, std.utf; void main() { string str = "チ"; writeln(decode(str, 0)); }
Comment #1 by jack — 2016-09-07T15:11:16Z
Marking as won't fix, see https://github.com/dlang/phobos/pull/4492 for rationale