Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
api: fixed zero producing warnings for primitive types in C++. #330
We also stop using empty() and ! as a basis for checking for zero-ness,
It is probably fine to make that assumption and document it as such, as
We also stop using empty() and ! as a basis for checking for zero-ness, and instead we simply compare the current parameter with the zero value of the type. This does requires that the type is default-constructible, which is, I think, reasonable, because a type that does not have a default-constructor cannot be guantanteed to define what a "zero-value" of itself means, if any. It is probably fine to make that assumption and document it as such, as the obvious workaround is to cr_assert the appropriate boolean condition.