From: Alexey Vakhov <vahov@dgap.mipt.ru> To: ALTLinux <community@altlinux.ru> Subject: [Comm] [C++] обработка исключений Date: Tue, 18 Mar 2003 12:05:56 +0300 Message-ID: <20030318120556.74ddb782.vahov@dgap.mipt.ru> (raw) Здраствуйте ALL! Есть такой вопросик: class simple{ public: simple() throw(int); } int main(){ try{ simple* s = new simple(); } catch(int& i){ cout << "Err!!" << endl; } } Предположим что в конструкторе возникло исключение, создатся ли объект, нужно будет ли вызывать delete s? Или лучше не использовать исключения в конструкторах, а попытаться как-нибудь создать объект, а потом его корректно удалить. А исключения вызывать в остальных функциях. Вспомнил $g++ --version i586-alt-linux-g++ (GCC) 3.2.1 (ALT Linux, build 3.2.1-alt2) -- Алексей mailto:vahov@dgap.mipt.ru ICQ 135869465
next reply other threads:[~2003-03-18 9:05 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-18 9:05 Alexey Vakhov [this message] 2003-03-18 12:53 ` Leonid B. Sysoletin 2003-03-18 17:15 ` Alexey Voinov 2003-03-18 21:48 ` Alexey Vakhov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030318120556.74ddb782.vahov@dgap.mipt.ru \ --to=vahov@dgap.mipt.ru \ --cc=community@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git