void f(int* a) { cout <<* a << endl; } int main() { shared_ptr<int> p(new int(3)); f(p.get());//shared_ptr<int> 是无法隐式转换成int* ,但用.get()就可以把她转换回原始指针 }