replace auto_ptr with unique_ptr (creeped in from 2.3.x)