Eigenpoll : D wish list : Auto const member funcs 

With the const system (as in C++), you often have to write two identical functions - one is const, the other is nonconst. I.e.:

T opIndex(size_t i) { return arr[i]: }
const(T) opIndex(size_t i) const { return arr[i]; }


This is a nuisance. It would be nice to have a means of writing the function once and indicate that there should be both a const and non-const version.

One suggestion:

autoconst T opIndex(size_t i) { return arr[i]: }




Report this item for cleanup