Can I use the nullptr
keyword as an argument for a variable function? If so, does it undergo any kind of standard conversion, and what is the type of the resulting value?
Concretely, is the following correct?
std::printf("%p", nullptr);
Or does it have to be:
std::printf("%p", static_cast<void *>(nullptr));
§5.2.2p7 When there is no parameter for a given argument, the argument is passed in such a way that the receiving function can obtain the value of the argument by invoking
va_arg
(18.10)... An argument that has (possibly cv-qualified) typestd::nullptr_t
is converted to typevoid*
(4.10)...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With