When using the 'pointer-passing interface' feature, I'd like to be able to just pass a nullptr to a function expecting a 'pointer argument' instead of going through the cumbersome effort of creating typed 'null pointers'. This is also a C++ programmer's natural expectation.
E.g., given
struct remember_fn {
int64 operator()(int64 value, carray_pointer_arg<int64> pv) const {
if(int64* observer = pv) {
*observer = value;
}
return value;
}
static constexpr const char* name() {
return "remember";
}
};
Use nullptr
select(func<remember_fn(&Object::id, nullptr))
instead of
select(func<remember_fn(&Object::id, statically_bindable_pointer<carray_pvt>(nullptr))