Add AutoPtr implementation according to the libstdc++