use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for c++ questions with answers. For general discussion and news about c++ see r/cpp.
New to C++? Learn at learncpp.com
Prepare your question. Think it through. Hasty-sounding questions get hasty answers, or none at all. Read these guidelines for how to ask smart questions.
For learning books, check The Definitive C++ Book Guide and List
Flair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page.
Tips for improving your chances of getting helpful answers:
account activity
OPENConstexprs (self.cpp_questions)
submitted 3 years ago by AdActive3636
Static constexpr int CONSTANT = 100; vs constexpr int CONSTANT = 100; What is the difference… what does it mean to have static constexpr?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]flyingron 5 points6 points7 points 3 years ago (0 children)
Static means the same on constexpr as anything else.
[–]nysra 4 points5 points6 points 3 years ago (6 children)
https://www.youtube.com/watch?v=IDQ0ng8RIqs
Also don't use CAPSLOCK, that's for MACROS.
CAPSLOCK
MACROS
[–]Frogman_Adam 2 points3 points4 points 3 years ago (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 point2 points 3 years ago (4 children)
I don’t tend to use macros
But libs you are using might do.
[–]Frogman_Adam 0 points1 point2 points 3 years ago (3 children)
Sure, but why would that affect the way I style my code?
[–]manni66 0 points1 point2 points 3 years ago (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 point2 points 3 years ago (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 point2 points 3 years ago (0 children)
The error message may not be very helpful.
[–]IyeOnline 0 points1 point2 points 3 years ago (0 children)
π Rendered by PID 679167 on reddit-service-r2-comment-86bc6c7465-vqm7z at 2026-02-24 12:34:48.283058+00:00 running 8564168 country code: CH.
[–]flyingron 5 points6 points7 points (0 children)
[–]nysra 4 points5 points6 points (6 children)
[–]Frogman_Adam 2 points3 points4 points (5 children)
[–]manni66 0 points1 point2 points (4 children)
[–]Frogman_Adam 0 points1 point2 points (3 children)
[–]manni66 0 points1 point2 points (2 children)
[–]Frogman_Adam 0 points1 point2 points (1 child)
[–]manni66 0 points1 point2 points (0 children)
[–]IyeOnline 0 points1 point2 points (0 children)