Hacker News new | ask | show | jobs
by geocar 2011 days ago
> Over a decade ago I was trying to get the C++ committee to support multidimensional arrays via overloading, so we could have 2D collections.

You might've asked operator[] to take multiple arguments separated by semicolon, so:

    foo[a;b]
which is at least unambiguous. Maybe it would have been less offensive.

> So I asked the question, could anyone find an example of the comma operator used in C or C++ inside square brackets in any production code.

If you're still referring to operator overloading, there's things like Boost.Assign and Boost.Phoenix, but if you're referring to use as a sequence operator, i.e. where a[b,c] could potentially be b,a[c] except for the different sequence point, it doesn't surprise me you had a hard time finding an example: I've only ever seen people like Arthur do that (people writing APL in C)