c++ shared_ptr?????????????????
???????????? ???????[ 2012/9/18 10:24:00 ] ????????
????shared_ptr??boost?е?λ??????????????????????????????????????????????????????????????????????????????c++?????????в?????????????????????????????????????????????й???????????????????Щ????????????????????????????????????????shared_ptr??????????????????????????????shared_ptr???????????
????1??share_ptr??????????????????????????????????????????????????????????????????????????????????share_ptr?????????????????????????????? *??->?????share_ptr??????????÷????????????????share_ptr??????????????????????????????????????????????????????????ɡ??????
????2???????????????share_ptr???????????????c++???????????????static_cast??dynamic_cast??const_cast????????static_pointer_cast??dynamic_pointer_cast??const_pointer_cast?????????????static_cast??dynamic_cast??const_cast??????????????????????????static_cast
????3??share_ptr??????????????????????а?????ε????????????????????п?????share_ptr?????????????????????void*????????????????????洢void*?????????????share_ptr??void*????????????????????????????????????????????????????????????????????void??????shared_ptr??????????2?е???????????????????????????????????????????
????4??share_ptr??????????????????????????????й???????????????????????????????С??????????????????????????????????????ν?share_ptr?????????????
????????????????е?????#include
#include
#include
using namespace std;
using namespace boost;
int main ()
{
typedef vector< shared_ptr
sharedContainers sharedArray(10);
for(sharedContainers::interator pos = sharedArray.begin() ?? int i=0 ;pos!=sharedArray.end();++pos)
{
*pos = make_shared
cout<<*(*pos)<<" ";
}
cout<
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11