www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13637] New: std.utf.decode: index parameter should be able to


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


Oct 19 2014