Below is a wrapper class I found in the 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;
};
I could not understand the meaning of declaration:
int_ptr_wrapper(int value = 0) :
mInt(new int(value))
{}
Can you explain the meaning of this declaration in details?