Is it possible to make this int const?
Hi,
do you know any workaround to make the integer UNIT const?
Code:
int UNIT;
try
{
UNIT = boost::lexical_cast<int>(argv[2]);
}
catch(const boost::bad_lexical_cast&)
{
cout << "Usage: input_file.bmp granularity(1..inf)" << endl;
exit(EXIT_FAILURE);
}
It can't be declared const, because then it can't get its assignment inside the try block. And also it can't be declared inside the try-block, because then it's bound to the scope try defines.
Thank you in advance!