!in operator
Jacek Nowak
jaceknowak at wp.eu
Sun Dec 26 07:24:42 PST 2010
Hi, I don't know if it's the right place for this, I prefer forums to
newsgroups. Anyway, I am learning D and trying to work with associative arrays.
Code (I'm using v1.065 of the DMD compiler):
int[char[]] arr;
if ("foo" in arr)
{
};
if ("foo" !in arr) // if (!("foo" in arr)) obviously works
{
};
unfortunately, only the first "if" statement works, while the second one gives
compiler errors:
hello.d|72|found '!' when expecting ')'|
hello.d|72|found 'in' instead of statement|
now, according to http://digitalmars.com/d/1.0/expression.html
"The !in expression is the logical negation of the in operation."
is it a known bug or am I misunderstanding something?
More information about the Digitalmars-d-learn
mailing list