Fix #1156, silence gcc warnings when compiled with --c++11

replaced auto_ptr with unique_ptr
fixed #1156 as it was stated in the link.