Just to be abundantly clear about his point.

// v is a const vector, but holds pointers ...

*v[0] = 5; // legal in C++, illegal in D (except in constructors which will allow this, ATM)

Transitivity gives you more information and guarantees about what you can and can't do with your view. Also, if the only view of the data you have is that const view, it's effectively the same as immutable (it couldn't be changed by any valid code).

Reply via email to