LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Blogs > TheIndependentAquarius
User Name
Password

Notices



Writing better code
Old

Understanding RAII (Resource Acquisition Is Initialization) - C++

Posted 06-14-2012 at 02:45 AM by TheIndependentAquarius
Updated 10-09-2012 at 03:44 AM by TheIndependentAquarius

  • Q: What is an exception safe code?
    A: A code may throw an exception but at the same time if it:
    • Doesn't allow any memory (allocated by it) to be leaked.
    • Lets the program to remain in a well-defined state (no dangling pointers
      and all) so that execution can continue as intended.
    • Reports the error to the caller (when encountered).
    then it can be termed as an exception safe code.

    Of course, a code which won't be throwing any exception ever is an exception
...
Senior Member
Views 1131 Comments 0 TheIndependentAquarius is offline

  



All times are GMT -5. The time now is 02:01 AM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration