
At 2:37 PM -0500 5/16/08, Nevin \":-]\" Liber wrote:
2008/5/16 Kevin Martin
: My problem is module interfaces. I have a module (set of classes) that solve a problem, and they require data. They don't care whether that data is on the heap, the stack, or the moon. They just want a pointer to it. In this case it is arguable that the pointers passed shouldn't be smart pointers at all, just normal pointers.
My general rule of thumb is that if mucking with ownership or lifetime, pass a smart pointer. If not, pass a raw pointer.
A brief addenda (from my rules of thumb) for non-ownership cases: * If the parameter is optional, pass a raw pointer, and the callee should expect a NULL pointer. * If the parameter is not optional, pass a reference. -- -- Marshall Marshall Clow Idio Software mailto:marshall@idio.com It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning. It is by caffeine alone I set my mind in motion.