3 ms·
Why only an unhip, old geezer would write outdated drivel like: const int MAX_SIZE = 1024; const int HEADER_SIZE = 128; set_content_size(HEADER_SIZE - MA
by kazinator 4y ago
Why only an unhip, old geezer would write outdated drivel like:
const int MAX_SIZE = 1024;
const int HEADER_SIZE = 128;
set_content_size(HEADER_SIZE - MAX_SIZE);
- ncmncm 4y agoProbably less geezery to write set_content_size(MAX_SIZE-HEADER_SIZE); Sayin'.
- kazinator 4y agoNever mind the operand order; what do we gain by using constexpr instead of const? In C++, const int x = 3 is already a constant. As of C++98 already, you can use x as a case label in a switch statement. It cannot be any more constant. Not cool any more?
- ncmncm 4y agoYou just want to ensure they don't take up space in your struct body. Otherwise, const is fine.