fix compile warning with gcc: using std::unique_ptr instead of std::auto_ptr