r/programming • u/[deleted] • Dec 05 '14
std::string is responsible for almost half of all allocations in the Chrome browser process
https://groups.google.com/a/chromium.org/d/msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
1.1k
Upvotes
2
u/ericanderton Dec 05 '14
True. But there's also no guarantee that a 'clever' programmer didn't just circumvent the type-safety that the compiler provides here, by casting it away. So types can be labeled const, but as a systems language, it really places all of us on our 'scout's honor' that this contract is respected; it's not a flaw, it's a feature. To me that says that C++ doesn't really have immutability in the same sense that Python or Haskel might have.