digitalmars.D.bugs - [Issue 12784] New: Add an "in" operator for std.json.JSONValue
- via Digitalmars-d-bugs (19/19) May 21 2014 https://issues.dlang.org/show_bug.cgi?id=12784
https://issues.dlang.org/show_bug.cgi?id=12784 Issue ID: 12784 Summary: Add an "in" operator for std.json.JSONValue Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: enhancement Priority: P1 Component: Phobos Assignee: nobody puremagic.com Reporter: markisaa umich.edu Currently the only way to check if a JSONValue (that is of type JSON_TYPE.OBJECT) contains a particular key/property is to wrap opIndex with a try catch block. This feels horribly clumsy. We should have an opBinaryRight "in" operator to allow checking without throwing. Expect a pull request with the "fix" by end of day. --
May 21 2014