October 19, 2014 [Issue 13637] New: std.utf.decode: index parameter should be able to pass by value | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=13637 Issue ID: 13637 Summary: std.utf.decode: index parameter should be able to pass by value Product: D Version: unspecified Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: Phobos Assignee: nobody@puremagic.com Reporter: neuranuz@gmail.com 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)); } -- |
Copyright © 1999-2021 by the D Language Foundation