https://issues.dlang.org/show_bug.cgi?id=22255

          Issue ID: 22255
           Summary: JSONValue.opBinaryRight!"in" is const
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: phobos
          Assignee: [email protected]
          Reporter: [email protected]

The following code fails to compile:

JSONValue j = [ "foo": "bar" ];
if (JSONValue* f = "foo" in j) // Error: cannot convert `const(JSONValue)*` to
`JSONValue*`
        *f = "baz";

making the method inout would solve the problem:
https://github.com/dlang/phobos/pull/8218

--

Reply via email to