
Is it possible to construct metafunctions that allow a
of NULL, but not any other integer value? Or at least cause
function argument the compiler
to call out whenever a non-NULL argument is provided?
Cheers, Stefan
struct convertible_from_null { struct null_pointer_impl_t; typedef null_pointer_impl_t (convertible_from_null::*null_pointer_t)(); convertible_from_null(null_pointer_t* = 0) {} };
convertible_from_null test = 0;
//convertible_from_null fail = 1;
int main() {}
In Christ, Steven Watanabe
Thanks a lot, this did it! I also managed to adapt this construct to provide comparison operators for comparisons with NULL values, so all my issues have been resolved. :) So now, apart from direct pointer assignments and delete statements (which I know need to be fixed anyway) my array iterator mostly behaves like a pointer. Fortunately, thanks to Steven's suggestion, the compiler does now show up all the problematic statements. Cheers, Stefan