Michael Torrie <torr...@gmail.com> writes: > Follow basic [C++] rules and 99% of segfaults will never happen and > the majority of leaks will not happen either.
That is a safe and simple approach, but it works by copying data all over the place instead of passing pointers, resulting in performance loss. Alex Martelli used to post a good riff here about how the main reason to use C++ in the first place was for when you needed to explicitly control resources for performance. So the "data copying" style seems to somewhat miss the point. Smart pointers have similar issues to Python's reference-counted allocation, e.g. cache and thread unfriendliness, and no compaction mechanism AFAIK. Plus I always found them scary in terms of subtle bug potential due to abstraction leaks. But I haven't used them so far. -- https://mail.python.org/mailman/listinfo/python-list