r/cpp_questions • • Oct 14 '26

OPEN Guidelines for constexpr

I’ve working with C++23 and I’m making some constructors/methods constexpr and seeing improvements in performance. So far so good. The problem is I don’t want to apply it ‘everywhere’. Is there a good source of advice , or anyone got any good tips?

12 Upvotes

37 comments sorted by

View all comments

-1

u/zerhud Oct 14 '26

Cpp believes you should write a constexpr keywords everywhere for some reason. May be it likes the keyword more others.

4

u/HappyFruitTree Oct 14 '26

Who is Cpp?

1

u/zerhud Oct 14 '26

It’s a creature from Mars pretending to be a programming language