X
xmllmx
As we know, count_if() will never return a negative number. So, it
seems evident that the return type of count_if() should be "unsigned
integral type" rather than "signed integral type".
However, to my surprise, the C++ standard should define the return
type is "signed integer type", which causes a lot of conceptual
confusions and annoying compiling warnings such as "signed/unsigned
mismatch".
What's the rationale for the C++ standard committee to do so ?
Thanks in advance!
seems evident that the return type of count_if() should be "unsigned
integral type" rather than "signed integral type".
However, to my surprise, the C++ standard should define the return
type is "signed integer type", which causes a lot of conceptual
confusions and annoying compiling warnings such as "signed/unsigned
mismatch".
What's the rationale for the C++ standard committee to do so ?
Thanks in advance!