C++ How to block negative numbers being passed as argument where unsigned is expected
i already saw this thread, however the situation is totally different and i cant apply that solution to my problem. i have the following constructor: Fan::Fan(Id id, std::string name, Age age); where Id and Age are typedef'ed unsigned int and unsigned short. this is given to me, so i know that i must use them, as most likely the tester of the assignment will try to use numbers bigger than int (in range of unsigned int / short). obviously, a Fan's id and age cannot be negative numbers. in the example code (to compile against), a fan is created with numbers for id and age. i cannot use string