Hopefully not-too-obvious observation

Jerry jlquinn at optonline.net
Wed Jul 17 19:50:09 PDT 2013


Hi folks,

I was looking at writing a hash-like class with a specific operator and
disliking the syntax of:

T opBinary(string op)(U key) if (op == "in") {}

When it occurred to me that it could be simply tightened up as:

T opBinary(string op : "in")(U key) {}

Any thoughts?  Is this bad style?

Thanks
Jerry



More information about the Digitalmars-d mailing list