我使用这个C++代码将x存储到变量val中。类中的C++ typedef
class Hello
{
int val;
public:
Hello(int x) : val(x) {}
};
但是,当我看到这段代码时,我看不出Super如何存储值t或o。
template<typename T>
class K : public std::auto_ptr<T>
{
typedef std::auto_ptr<T> Super;
public:
K() : Super() { }
K(T* t) : Super(t) { }
K(K<T>& o) : Super(o) { }
};
此代码是如何工作的?
对混淆部分是什么有点澄清? – 2011-03-03 21:49:18