Const vs constexpr

I would like your opinion.

I use:
constexpr only for constant values
const for values ​​that will become constant as parameters of functions, classes and functions.

but I didn’t notice a difference between the two, just a difference in good use.

Like typename and class in templates

constexpr everywhere you can, otherwise const.

constexpr > const > nothing

See here on the difference:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms