Today I saw this code, inside a class:
static const uint32_t invalid_index = ~uint32_t();
My question is, what is the return value of a uint32_t destructor, and why is it useful?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s not a destructor, but a bitwise
NOToperator applied to a value-initializeduint32_t.A value initialized integral type is
0, so you’re taking the bitwiseNOTof0.Similar to: