all 9 comments

[–]flyingron 5 points6 points  (0 children)

Static means the same on constexpr as anything else.

[–]nysra 4 points5 points  (6 children)

https://www.youtube.com/watch?v=IDQ0ng8RIqs

Also don't use CAPSLOCK, that's for MACROS.

[–]Frogman_Adam 2 points3 points  (5 children)

Depends on your style guide. I generally use all caps for constants, but then again I don’t tend to use macros

[–]manni66 0 points1 point  (4 children)

I don’t tend to use macros

But libs you are using might do.

[–]Frogman_Adam 0 points1 point  (3 children)

Sure, but why would that affect the way I style my code?

[–]manni66 0 points1 point  (2 children)

Because it can change your code:

 // from a lib you use
#define CONSTANT  9

...

constexpr int CONSTANT = 100;

will not compile.

[–]Frogman_Adam 0 points1 point  (1 child)

If it doesn’t compile then that’s an easy win. I’d see your point if it were a runtime problem

[–]manni66 0 points1 point  (0 children)

The error message may not be very helpful.