C++相談室 part75
■ このスレッドは過去ログ倉庫に格納されています
0720716
2009/12/11(金) 00:41:33#include <string>
#include <iostream>
#include <boost/shared_ptr.hpp>
using namespace std;
using namespace boost;
class cls {
public:
shared_ptr<string> str;
cls(){ str=shared_ptr<string>(new string);str->resize(1<<20,'a'); }
};
void fnc(shared_ptr<cls> p){
//cout<<p->str->substr(0,10)<<endl;
}
int main(){
int n;
for(n=0;n<1000;n++) {
shared_ptr<cls> p=shared_ptr<cls>(new cls);
cout<<n<<endl;
fnc(p);
}
}
■ このスレッドは過去ログ倉庫に格納されています