[SVN r81901]
[SVN r81900]
It is adopted from n2351 "Improving shared_ptr for C++0x, Revision 2". Also includes some minor corrections. Refs #1897 [SVN r51699]