引用http://www.parashift.com/c++-faq-lite/ref-count-simple.html
class Fred {
public:
static FredPtr create(); // Defined below class FredPtr {...};
static FredPtr create(int i, int j); // Defined below class FredPtr {...};
...
private:
Fred();
Fred(int i, int j);
...
};
class FredPtr { /* ... */ };
inline FredPtr Fred::create() { return new Fred(); }
inline FredPtr Fred::create(int i, int j) { return new Fred(i,j); }
new Fred() 如何在最后两行代码中返回 FredPtr?我不明白。