4 Pointer(T * const pointer) : _pointer(pointer) { } 5 ~Pointer() { 6 delete _pointer; 7 } 8 private: 9 T * const _pointer; 10 }; 11 12 int main(const int argc, const char* const argv[]) { 13 Pointer<int> p(new int); 14 // some procedures 15 16 return 0; 17 } RAII ΠσΟΦϜ 18 from C++ σετϥΫλʔ Ͱղ์ Ϧιʔε֬อͱ ॳظԽΛಉ࣌ʹ ྫ֎͕ඈΜͰ ղ์͞ΕΔ