use unique_ptr instead of auto_ptr when c++11 is enabled