请教C++语句:shared_ptr<T>static_pointer_cast(const shared_ptr<U>&r)

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:46:48
十分不理解呀?这里的语法,以及各个参数的意义= =?
请教鈊_烦_薏乱为什么在函数的开头写上返回值呀,const shared_ptr<U>&r 这个参数,为什么用取址符?

很简单,这是一个函数。
shared_ptr<T>是返回值
函数名称:static_pointer_cast;
参数const shared_ptr<U>&r'
就这么简单。

补充:那不叫取址。。那叫引用。
你难道这点c++基础都没有?那你还敢看Boost源码?

难得在这里看到有人用boost