From: "Daniel Frey" <[EMAIL PROTECTED]> > Peter Dimov wrote: > > > > I'm thinking of renaming make_shared(weak_ptr), as the current similarity > > with make_pair is undesirable. The best replacement I can come up with is > > I fail to see the problem. The similarity is IMHO helpful, as both > deduce the type to generate from their parameters.
make_X(args) is typically equivalent to X<...>(args). However, make_shared is not equivalent to the corresponding constructor. The constructor throws an exception when the argument has expired(), and make_shared returns an empty shared_ptr. > > get_shared_ptr. I.e. instead of > > 'get' implies (at least to me), that it only fetches a pointer/reference > to something which already exists. In a way, this is exactly what make_shared/get_shared_ptr does; it fetches a pointer to something which already exists, the object. In a garbage collected language, where ordinary pointers keep objects alive, it could have been named T * weak_ptr::get() const; or T * get_pointer(weak_ptr const &); _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost