Provide operator<<(std::ostream, global_ptr<T>)

Issue #98 resolved
Dan Bonachea created an issue

Currently there is no supported way for a UPC++ program to output the contents of a global_ptr<T> that is not local() for debugging purposes. It would be helpful if we could provide an ostream overload for global_ptr<T> that :

  1. Prints an implementation-defined representation of the affinity and raw pointer
  2. Works on any valid gptr (regardless of affinity)
  3. Is guaranteed to generate textually-identical output for any two gptrs if and only if they'd compare equal via global_ptr<T>::operator==(global_ptr<T> rhs)

Our global_ptr<T> implementation already includes a private method that I believe meets these criteria, I think all that needs to happen is to make it public and document it in the spec.

Comments (2)

  1. Log in to comment