C/C++
smartptr.txt
Associated article: Implementing operator-> for Smart Pointers
Tags: Design C/C++ Tools
Published source code accompanying the article by Scott Meyers in which he examines how you can make smart pointers as behaviorally compatible with built-in pointers as possible, you should support operator->*--just like built-in pointers do. Also see SMARTPTR.ZIP.
Implementing operator->* For Smart Pointers
by Scott Meyers
Listing One
class Wombat { // wombats are cute Australian marsupials
public: // that look something like dogs
int dig(); // return depth dug
int sleep(); // return time slept
};
typedef int (Wombat::*PWMF)(); // PWMF--a pointer ...


