I believe D has the potential to add yet another cool feature to its suite of compilers, namely the power to disallow non-side-effect calls to pure functions.
For example
auto s = "a";
toStringz(a);
should error just like
a == "";
currently errors in DMD as
Error: == has no effect in expression (s == "")
Such as feature would prevent the programmer from accidentally calling non-muting algorithms when he expects it to have in-place (mutating) semantics. This without having to explicitly tag functions with attributes such as GCC's __attribute((warn_unused_result))
alongside __attribute((const))
.
Is such a feature on the todo list for DMD?