Saturday, October 01, 2005

The big three and exception safety

Lets see how we can relate "the big three" of C++ (copy constructor, copy assignment operator and destructor) to the levels of expception safety.

1. Constructor (default, copy) should provide basic exception guarantee (no memory leakes)
2. copy assignment operator should provide strong exception guarantee (commit-or-rollback)
3. destructor should provide no-throw guarantee. (should not fail)
4. Containter templates should provide all above + exception neutrality (pass the exception thrown by parameter types).

See some earlier posts on this blog for more info on exception safety levels. Also see http://www.boost.org/more/generic_exception_safety.html

6 comments:

lightly-blended said...

Wondrous blog. Your site was very pleasing and I
will go back again! I like surfing the net for blogs
as good as yours.
I wish I was like you, but I'll go and peep your 1800contacts coupon code blog.

florida mortgage lenderf7 said...

Creative blog. I just kept looking at it over and
over! Im always looking for blogs like this!
My blog, is something you need to peep out!

final fantasy 10 musicd said...

Great blog. I'm always finding blog like yours. It
got my attention and I will go to the site again!
Please examine my 1800contacts coupon code blog as soon as you can.

maryland mortgagee said...

Excellent blog.  I go though the web in search of
blogs like this one. Its so good, that I plan on
returning to its site!
I want you to look for my 1800contacts coupon codes blog.

job opportunitya said...

Excellent blog.  I go though the web in search of
blogs like this one. Its so good, that I plan on
returning to its site!
Stop by and look at my blog site.

job opportunitya said...

Great blog.  I just like the site and I will get a
visit again! In my spare time I usually try and look
for blogs just as neat as yours.
Search for my bad celebrity plastic surgery blog, it will leave you speechless.