Static Indexers?

I believe it was considered not to be terribly useful. I think it’s a shame too – an example I tend to use is Encoding, where Encoding.GetEncoding("foo") could be Encoding["Foo"]. I don’t think it would come up very often, but aside from anything else it just feels a little inconsistent not to be available.

I would have to check, but I suspect it’s available in IL (Intermediate Language) already.

Leave a Comment