// 很多时候,我们在使用某个数据,但并不十分关心其类型是什么。
#include <memory>
#include <string>
#include <iostream>
using namespace std;
int main( )
{
auto_ptr< string > ps( new string( "clark" ) );
cout << *ps << endl;
cout << ps->size( ) << endl;
}
C++ auto_ptr的用法
最新推荐文章于 2023-04-21 18:47:04 发布