Added shared_ptr handling for C++03 mode.