getting a normal ptr from shared_ptr?

后端 未结 3 2174
花落未央
花落未央 2020-12-28 12:03

I have something like shared_ptr t(makeSomething(), mem_fun(&Type::deleteMe)) I now need to call C styled function that requires a pointer to

3条回答
  •  孤城傲影
    2020-12-28 12:13

    For std::shared_ptr (C++11 onwards) also, there is a get method to obtain the raw pointer. link

提交回复
热议问题