
On 4/26/2011 3:34 PM, Matthew Chambers wrote:
On 4/26/2011 5:00 PM, Phil Bouchard wrote:
None of those seem like very good options: mutual is a synonym for shared.
;)
Even shared_ptr's name does not say what its sharing mechanism is (apparently ref_counted_ptr wasn't popular!), so trying to inject those semantics into a short name is probably asking too much of the name. Algorithms are often qualified by their creators' names: have you considered naming the ptr after the creator of its sharing mechanism? Conceptually, shared_ptr could have had sharing semantics injected by a template parameter (like the RNG concept has semantics injected by algorithms named like mt19937), but obviously it's too late for that.
A policy-based smart pointer encapsulating mm_ptr would have been quite a challenge because of the extra functionality required to initialize pointee objects. Perhaps a smart_ptr class template could be implemented to handle all of shared_ptr, intrusive_ptr, weak_ptr and mm_ptr.
Have you ever met Edward Diener? The reaction of naming affinity vs. naming apathy could power a small country. ;)
The psychologist? I'm careful selecting the right word but so far mutual_ptr wins because it means what it means and won't clash with other keywords. -Phil