2009-07-25から1日間の記事一覧
スコープ内で宣言してスコープ外に出ると自動破棄されるmain.cpp #include <boost/scoped_ptr.hpp> #include <string> #include <iostream> using namespace std; using namespace boost; int main(int argc, char* argv[]) { scoped_ptr<string> p(new string("scoped ptrを使う")); if(p) cout << *p << end</string></iostream></string></boost/scoped_ptr.hpp>…