Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What does it mean to declare a member function as virtual?

1022


What is the difference between map and hashmap in c++?

1054


What does new do in c++?

1029


How do you compile the source code with your compiler?

1017


How would you use qsort() function to sort an array of structures?

1077


What are the methods of exporting a function from a dll?

1158


What is endl c++?

1047


What is an inline function in c++?

1081


What is ios flag in c++?

1144


What are different types of loops in c++?

1084


What are the c++ access specifiers?

1363


What's the "software peter principleā€?

1105


What is a stack? How it can be implemented?

1135


Define a conversion constructor?

1037


Which c++ compiler is best?

1110