Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Advice in u...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 9272 of 9983
Post > Topic >>

Re: Advice in using boost and STL

by "Thiruvalluvan M. G" <thiruvalluvan@[EMAIL PROTECTED] > Feb 5, 2008 at 04:09 PM

On Feb 5, 4:22 am, ManicQin <Manic...@[EMAIL PROTECTED]
> wrote:
>
> I'm sorry there's something I'm missing that I will love to catch up.
> Since when STL and Boost are "coupled" with exception handling?
> Are there any libraries that are specific for "un-safe" programming?
>
Both STL and Boost for the most part don't need exceptions. They can
work pretty well without them. But the containers and algorithms of
STL (and some boost libraries) use default constructors, copy
constructors and copy assignment operators on their elements (objects
of your class) quite freely. They are not going to check if these
operations succeeded using the custom error checking you have
designed. They simply assume that return from these operations means
they are successful, which is not true in most real world cases. In
other words, they expect the user types to throw an exception if any
of these common operations fail.

> I accept with Richard that they are "exception neutral" why is it so
> im****tant?
>

It is im****tant in cases where you have types that never fail in
default construction, copy construction and copy assignment operation.
For example, if you dealing with a primitive type such as int, STL is
exception free.

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 1 Posts in Topic:
Re: Advice in using boost and STL
"Thiruvalluvan M. G&  2008-02-05 16:09:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 3:52:54 CDT 2008.