提交 cef08b25 编写于 作者: W wuyongning

update shared_ptr from new to make_shared

Signed-off-by: Nwuyongning <wuyongning@huawei.com>
上级 0602408b
......@@ -165,7 +165,7 @@
订阅数据变化,并触发执行回调方法:
``` C++
std::shared_ptr<PreferencesObserver> counter =
std::shared_ptr<PreferencesObserver>(new PreferencesObserverCounter());
std::make_shared<PreferencesObserverCounter>();
pref->RegisterObserver(counter); // 注册数据变化的回调。
pref->PutString(PreferencesTest::KEY_TEST_STRING_ELEMENT, "test");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册