Question to C++ pros: are there not idioms that can be used and ruthlessly enforced to avoid such problems entirely?

Is this the result of 'open use of pointers' that inevitably causes problems here and there?

Or is this problem due to the fact is just impossible to use even hard idioms to avoid such problems? (Or hard to enforce them?)

On some small-to-midsized projects I've seen narrow and rigorously enforced rules around pointers that seemed to work well. So what's up?