RAII 㨠setjmp/longjmp C++ ã«ã¯ RAII (Resource Acquisition Is Initialization) ã¨ããã¤ãã£ãªã ãããã¾ããããã¯ãªã½ã¼ã¹ã®éæ¾ã確å®ã«è¡ãããã®ãã¯ããã¯ã¨ã㦠C++ ã®ããã°ã©ã ã§åºãç¨ãããã¦ãã¾ããããããRAII ã setjmp/longjmp ã¨ããè½ã¨ãç©´ãããã¾ãã RAIIã®åºæ¬ 次ã®ããã°ã©ã ã¯ã¡ã¢ãªãªã¼ã¯ãèµ·ããã¾ãã #include <string> using namespace std; int main() { string *p = new string; return 0; } ãã®ããã°ã©ã ããã«ãã㦠valgrind ã§ãã¹ãããã¨æ¬¡ã®ãããªã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示ããã¾ãã4ãã¤ãã®ã¡ã¢ãªãªã¼ã¯ãæ¤åºããã¾ããã % g++ test.cc % valgrind ./a.ou
{{#tags}}- {{label}}
{{/tags}}