473,508 Members | 2,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

STL: which functions can throw exceptions

Hi,

i am using some STL containers in a library of mine.
how can i see which exceptions can occur when doing something
with those containers (adding an elemnt for example)

i have looked in the MSDN collection, but class members lists nothing, and
the specific functions also don't mention anything.

am i looking in the wrong place or doi have to find my way through the STL
sources?

kind regards,
Bruno.
Nov 17 '05 #1
1 1275
On Tue, 28 Sep 2004 11:25:04 +0200, "Bruno van Dooren"
<mi******@hotmail.com> wrote:
Hi,

i am using some STL containers in a library of mine.
how can i see which exceptions can occur when doing something
with those containers (adding an elemnt for example)
Generally anything that might allocate memory might throw
std::bad_alloc.
i have looked in the MSDN collection, but class members lists nothing, and
the specific functions also don't mention anything.
Generally the exceptions they throw depend on the exceptions that the
held types throw. If you have a vector<MyType> and the MyType copy
constructor throws, then lots of vector's methods may throw that
exception.
am i looking in the wrong place or doi have to find my way through the STL
sources?


There's a good .pdf on library exception safety here:

http://www.research.att.com/~bs/3rd_safe0.html

(or buy the book).

Tom
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3731
by: forums_mp | last post by:
I've got an STL class (see below) with two functions to store and retrieve data - msg structs. The "Store" function when called will copy the received message (depending on which message) into...
5
1398
by: Mark | last post by:
Hi, I can't seem to find any documentation as to how STL indicates method failure, whether by return code or exception. e.g how would I test for out of memory case when inserting into a...
1
2371
by: Shane Groff | last post by:
I'm sorry if this is a FAQ, but I've been unable to find exactly what I'm looking for. Does the STL make the no-throw guarantee for any of the STL containers? E.g. If I have a...
2
2386
by: Barry Hynes | last post by:
G'Day folks, Have been working on this problem for quite some time and still no farther ahead. :( Here is my problem...bare with me i am very green :) I have to implement a Safe List,...
49
8896
by: Alex Vinokur | last post by:
Are there any restrictions/problems for use of C++ STL in development in embedded systems? In particular: * Does STL require too much space/memory? * Is 'implementation of STL...
3
4580
by: Dmitry Prokoptsev | last post by:
Hello, I need to write a class for exceptions which can be thrown, caught, stored and thrown once again. I have written the following code: --- begin --- #include <string> class Exception...
21
5680
by: T.A. | last post by:
I understand why it is not safe to inherit from STL containers, but I have found (in SGI STL documentation) that for example bidirectional_iterator class can be used to create your own iterator...
1
4824
by: krunalb | last post by:
Hi, As I understand STL are bound to throw an exception on occurrence of invalid condition. Is there a way in which I can use -fno-exceptions with STL. (Something similar to new(nothrow) ...
17
2930
by: osama178 | last post by:
Hi, What does it mean for an object to be binary compatible? And why aren't STL objects binary compatible? Any insights, links, resources for further reading are greatly appreciated. Thanks.
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.