May 17, 2017 at 3:32am UTC
Hello Guys, I just want to make sure of my answers
What do you think of these questions?
True or False
1) A regular virtual function declared in a base class must be implemented in the same base class.
2) In a base class, pure virtual function may be implemented in that class
3) A function declared as follows:
void func(parameter_list);
must no throw any exception
4) A function declared as follows:
void func(parameter_list) throw();
must not throw any exception
5) If an exception is thrown inside a function, say f(), but no handled there, the exception is propagated to the function that called f().
May 17, 2017 at 4:36am UTC
You didn't write your answers.
4.) False, but you should decide: the behavior is perfectly well-defined if it does throw, but std::unexpected
will be called: i.e., it is legal to throw from that function, although an empty exception specification is a promise you would not.
Last edited on May 17, 2017 at 4:37am UTC
May 17, 2017 at 7:06am UTC
1_ F
2_F
3_T
4_T
5_F
That's my answers