I agree that this requires some bit of training, and maybe I find it easy only because I know smart pointers inside out from years of COM. But this pattern (both the idea and the code) is highly reusable, e.g. just two days ago for enumerating firewire devices.