defining "in" What is the proper way in D2?

David Nadlinger see at klickverbot.at
Sun Sep 11 13:24:34 PDT 2011


On 9/11/11 10:02 PM, Charles Hixson wrote:
> What is the proper way to define the "in" operation in D2?

For containers, you typically want to use opBinaryRight:

---
bool opBinaryRight(string op : "in")(ElemType e) const {
   return …;
}
---

David


More information about the Digitalmars-d-learn mailing list