y‰SŽÒнŒ}zC/C++Ž ..
773:ƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ‚³‚ñ
08/02/16 13:19:46
‚Æ‚è‚ ‚¦‚¸‰´‚ªƒ`ƒFƒbƒN‚ÉŽg‚Á‚½ƒR[ƒhB
‚Ç‚¤•\ަ‚³‚ê‚éH
#include <iostream>
#include <memory>
class Test {
public:
Test(int n) : n(n) { }
~Test() { std::cout << "~Test(" << n << ")" << std::endl; }
static Test* New() {
Test test1(1);
std::auto_ptr<Test> test2(new Test(2));
throw 1;
return NULL;
}
private:
int n;
};
int main() {
try {
Test* test = Test::New();
test = test;
} catch(int n) {
std::cout << "catch" << std::endl;
}
return 0;
}
ŽŸƒy[ƒW‘±‚«‚ð•\ަ1‚ð•\ަÅVƒŒƒX•\ަƒXƒŒƒbƒh‚ÌŒŸõ—ÞŽ—ƒXƒŒˆê——˜b‘è‚̃jƒ…[ƒX‚¨‚Ü‚©‚¹ƒŠƒXƒg¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ‰É‚‚Ԃµ2ch
4943“ú‘O‚ÉXV/249 KB
’S“–:undef