class SmartPointer
{
int* _data;
public:
explicit SmartPointer(int* data) : _data(data)
{}
};
This code compiles:
SmartPointer p(nullptr);
But this one doesn't:
SmartPointer p = nullptr; // error C2440: 'initializing': cannot convert from 'nullptr' to 'SmartPointer'
Aren't these two ways of calling the copy constructor equivalent?