I couldn't find a way to check if the value that was passed into variable is right type.
For example: I have passed char into int variable and I would like to check if it is int inside int(?). I thought about checking if argument that was sent is in ascii table, but i don't find this as optimal solution. Some code:
Martice m('q');
when
Martice (int _arg) : pass(_arg) { allocation(); };
I know that I could use this method to check input:
if (std::cin.fail() == true) {
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
but my point is to check it later, after passing it as argument.