你好,我是 C++ 新手,
我正在尝试在字符串上使用共享指针。
class Test{
private:
void test(std::string* str);
boost::shared_ptr<std::string> sample;
};
void Test::test(std::string* str) {
sample.reset(str); //This is not working.
}
谁能告诉我出了什么问题?
你好,我是 C++ 新手,
我正在尝试在字符串上使用共享指针。
class Test{
private:
void test(std::string* str);
boost::shared_ptr<std::string> sample;
};
void Test::test(std::string* str) {
sample.reset(str); //This is not working.
}
谁能告诉我出了什么问题?