3 ms·
> Do you want C++ compiler to also prevent data races? Then use const functions by default, seriously. Tell me how to use const functions to enforce that I tak
by pcwalton 11y ago
> Do you want C++ compiler to also prevent data races? Then use const functions by default, seriously.
Tell me how to use const functions to enforce that I take a lock before accessing data guarded by a mutex. Or how to mutate data local to the current thread only, while forbidding mutation of shared data.
> Imagine if all the effort of 8 years of Rust team went into a modern C++ safety library.
I imagine our 8 years would have been wasted chasing the impossible.