- marked as critical
- edited description
is_local() on null gptr
Issue #57
resolved
bool result = global_ptr<T>(NULL).is_local()
What should this return?
This is ambiguous in the current spec.
Possible resolutions include:
- Add a precondition forbidding this method call on null global pointers
- Add text guaranteeing a false return for null global pointers
- Add text guaranteeing a true return for null global pointers
Note that .1 and .2 also imply that global_ptr<T>(NULL).local()
is prohibited, which seems overly restrictive and likely to add branches in code that is written to localize (non-remote) gptrs without regard to their specific value (or null-ness). FWIW, UPC allows down-casts of pointer-to-shared NULL to pointer-to-local NULL, without no special care required.
I vote for resolution .3
Comments (2)
-
reporter -
- changed status to resolved
Fixed in 56857b1, in favor of always returning true.
- Log in to comment