I'm starting writing class that should read configuration file and initialize some members with data from file. I decided to read this file in constructor. What should constructor do, if something goes wrong, and further construction of object have no sense? For now it displays message:
MultiReader::MultiReader(const char* m_sPath)
{
fConfigFile.open(m_sPath);
if(!fConfigFile)
cout << "Cannot open specified configuration file: "
<< m_sPath << endl;
}
Call destructor? break
illegal here I guess.
MultiReader A;
What will be passed to A
in case of such failure?