4 ms·
> No, it's completely wrong. You have no protection from dangling references in C++. I'd love to see an example without globals or an undefined behavior factor
by autoreleasepool 11y ago
> No, it's completely wrong. You have no protection from dangling references in C++.
I'd love to see an example without globals or an undefined behavior factory function.
- pcwalton 11y agoA "factory function" is just a function. Unless you have some way of statically distinguishing "factory functions" from functions, you are now arguing "you can write safe C++ if you make all your data immutable and you don't use functions". Besides the fact that this is not true (consider the destruction order for rvalues), how is this a statement that is possibly relevant to the real world?
- deleted 11y ago[deleted]