-1
下面是我在stackoverflow中找到的包装类。无法理解包装类构造函数的声明
class int_ptr_wrapper
{
public:
int_ptr_wrapper(int value = 0) :
mInt(new int(value))
{}
// note! needs copy-constructor and copy-assignment operator!
~int_ptr_wrapper()
{
delete mInt;
}
private:
int* mInt;
};
我无法理解声明的含义:
int_ptr_wrapper(int value = 0) :
mInt(new int(value))
{}
你能解释一下这个声明在细节的意义?