Hi,
do you know any workaround to make the integer UNIT const?
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.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); }
Thank you in advance!