compile with C++0x support
use std::unique_ptr