????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???????????????T???????????share_ptr?????????????????????????????ü???c++?????????share_ptr??????????????????????Υ???????share_ptr?????????????????????????????????????????????????????share_ptr???й???????????????????share_ptr???????????????????????????????static_pointer_cast??????????????shared_pointer??????????????й????

????3??share_ptr??????????????????????а?????ε????????????????????п?????share_ptr?????????????????????void*????????????????????洢void*?????????????share_ptr??void*????????????????????????????????????????????????????????????????????void??????shared_ptr??????????2?е???????????????????????????????????????????

????4??share_ptr??????????????????????????????й???????????????????????????????С??????????????????????????????????????ν?share_ptr?????????????

 

#include
#include
using namespace std;
using namespace boost;
int main ()
{
    typedef vector< shared_ptr > sharedContainers;
    sharedContainers sharedArray(10);
    for(sharedContainers::interator pos = sharedArray.begin() ?? int i=0 ;pos!=sharedArray.end();++pos)
     {
            *pos = make_shared(++i);
            cout<<*(*pos)<<" ";
     }
      cout< }

????????????????е?????#include ???????????#include ?????????make_shared.hpp????????????????????make_shared()?????????????new????????????????????в???pair?????make_pair().???make_shared.hpp?а?????smart_ptr.hpp???????????make_shared.hpp???????????smart_ptr.hpp?????????smart_ptr.hpp??а???make_shared.hpp??????????????д??make_shared.hpp??