C++ shared_ptr works
finished std::shared_ptr vs c++ pointer access performance comparison.