Closed mugiseyebrows closed 6 years ago
I think you're confusing static_casting a nullptr
versus static_casting an uninitialized pointer. Actually, static_cast
maps nullptr
to nullptr
, so the check is correct. This is mentioned in the standard:
"The null pointer value (4.10) is converted to the null pointer value of the destination type." (5.2.9-8)
I believe
static_cast
cannot return null if argument is not null, check is redundand and exception will never be thrown (assumingclientCallBackInfo
is not null, which can be checked less confusing way) https://github.com/emcrisostomo/fswatch/blob/91e529e0e217797ec3606f9f068c6f9f2ad1c279/libfswatch/src/libfswatch/c%2B%2B/fsevents_monitor.cpp#L196-L202