Reputation:
I have a colleague that is not keen on using modern C++
For example when I asked him to start using r_value reference he wouldn't do it. When I asked him to use std::array instead of c arrays (char example[8]) he wouldn't do it. When I asked him to stop doing c casts ( A* a = (A*)b ) he wouldn't do it. You get my point.
Usually I can find references of Scott Meyers or Bjarne Stroustrup of why modern C++ shouldn't be used this way, and then he cannot debate it anymore.
Unfortunately I cannot find a direct reference of anyone why is bad practise to use "unsigned" instead of "unsigned int". I managed to make me him used "singed" before "int but I cannot convince him to use "unsigned int".
So my question is should we use "unsigned int" instead of "unsigned"?
Upvotes: 0
Views: 214
Reputation: 238281
I cannot find a direct reference of anyone why is bad practise to use "unsigned" instead of "unsigned int"
That's probably because it isn't a practice that's considered bad by the majority (to my knowledge).
unsigned
and unsigned int
are exactly the same type, just as signed
, signed int
and int
are. I don't know of a case where using one over the other would have surprising results.
Given that the choice is primarily a matter of taste. Arguing about the choice is bike-shedding.
Upvotes: 3