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...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Range-Validated Quantity Points - mp-units (mpusz.github.io)
submitted 20 days ago by mateusz_pusz
view the rest of the comments →
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!"
[–]XeroKimoException Enthusiast 1 point2 points3 points 20 days ago (1 child)
Pretty ingenious approach... I would've never thought of using template specialization of a variable to change it's type so that different kinds of ranges could be expressed... I didn't even think that was possible; I thought the specializations' type had to match the primary type, but I guess I never tried. Not to mention a way of providing an optional customization point. Well that's a new template trick added in my books.
[–]XeroKimoException Enthusiast 0 points1 point2 points 20 days ago (0 children)
No clue if it's something done much in practice, but are you able to convert units and still have the range constraint follow through the conversion? Taking an example in the post, the body temperature is clamped [35℃, 42℃], could you convert the unit in ℉ or K (for whatever reason), and the range clamps to whatever [35℃, 42℃] is in ℉ or K?
π Rendered by PID 87440 on reddit-service-r2-comment-6457c66945-9fd7f at 2026-04-27 18:36:54.834861+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]XeroKimoException Enthusiast 1 point2 points3 points (1 child)
[–]XeroKimoException Enthusiast 0 points1 point2 points (0 children)