Reading some code I found a class accepting just the new C++11 nullptr_t
as parameter. The class looks like the one below.
Am I correct that the only thing I can construct an object by using exclusively nullptr
?
class CA {
public:
CA(nullptr_t) {}
};
No. This is covered in §4.10 [conv.ptr]:
where a null pointer constant is defined as follows:
In other words, your constructor can be invoked also with various integer literals of value 0: