Replace auto_ptr by shared_ptr.
Merge pull request #556 from chriseth/removeautoptr

Replace auto_ptr by shared_ptr.