queue and exception

  • Thread starter Thread starter George3
  • Start date Start date
G

George3

Hello everyone,


Just a basic question which I could not find answer from MSDN
currently, for frequently used member functions for queue class, there
is,

1. push;
2. pop;
3. back;
4. front.

I know (1) will throw exception, for example, out of memory. How about
(2), (3) and (4)? Will they be possible to throw any exceptions and in
what situations if there are exceptions? From MSDN declaration of
exception specification for the functions, I can not find the answer.


thanks in advance,
George
 
George3 said:
Hello everyone,


Just a basic question which I could not find answer from MSDN
currently, for frequently used member functions for queue class, there
is,

1. push;
2. pop;

yes - if the queue is empty.

yes - if the value-type's copy constructor throws or if the queue is empty.
4. front.

yes - if the value-type's copy constructor throws or if the queue is empty.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top