3 ms·
The difference between const in D and const in C++ is that D's const is transitive, and C++'s is not. Transitive const is necessary for things like pure functi
by WalterBright 8y ago
The difference between const in D and const in C++ is that D's const is transitive, and C++'s is not.
Transitive const is necessary for things like pure functions. It's more difficult to use because the compiler really, really means it. But when it's there, you (the user) knows that function is not modifying the const data structure, not no-how, not no-way.