This makes checks whether a returned (typed) pointer is null harder as they should be. While both types of nullptr are false-y, this check can't always be used, e.g. it couldn't differentiate between a nullptr and an empty vector in the example above. My generic way of testing for nullptr now is the following, but having to remember to use the function instead of != nullptr is still somewhat annoying and an easy source for errors.
The typed nullptr created by bind_object does not compare equal to the generic nullptr, i.e.
This makes checks whether a returned (typed) pointer is null harder as they should be. While both types of nullptr are false-y, this check can't always be used, e.g. it couldn't differentiate between a nullptr and an empty vector in the example above. My generic way of testing for nullptr now is the following, but having to remember to use the function instead of
!= nullptr
is still somewhat annoying and an easy source for errors.