is throwing exception from a constructor not a good practice ?
Answer Posted / manjunath
Throwing a exception from constructor is perfectly good
habit. That is how to handle errors in the constructor.
Smart pointers can also be used in this scenario.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What does it mean to declare a member function as virtual?
What is the difference between map and hashmap in c++?
What does new do in c++?
How do you compile the source code with your compiler?
How would you use qsort() function to sort an array of structures?
What are the methods of exporting a function from a dll?
What is endl c++?
What is an inline function in c++?
What is ios flag in c++?
What are different types of loops in c++?
What are the c++ access specifiers?
What's the "software peter principleā?
What is a stack? How it can be implemented?
Define a conversion constructor?
Which c++ compiler is best?