Hello, I have the following code scenario: A *pa = NULL; // pa will be allocated here (by 3rd-party function) // by setA(), // whose behavior could not be changed setA(pa); // prototype: void setA(A*& pa) //... pa->close(); I want to apply shared_ptr to make it easier to maintain, or, more specifically here, to save a close() call. new version: boost::shared_ptr<A> pa(NULL, boost::bind(&A::close, _1)); setA(pa.get()); // because get() returns T* instead of T*&, // this line chokes the compiler //pa->close(); not needed any more Is there any way to get my goal accomplished? Thanks for any help. B/Rgds Max ------------------------------------------------------------------- 新浪空间——与朋友开心分享网络新生活!(http://space.sina.com.cn/ )