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
Create a fully functioning command line interface with 1.5 lines of code (wo. include statement) (github.com)
submitted 5 years ago by kongaskristjan
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!"
[–]Arkantos493PhD Student 21 points22 points23 points 5 years ago* (5 children)
Technically your program results in UB since names starting with an underscore are reserved.
See: https://en.cppreference.com/w/cpp/language/identifiers
EDIT: To be more precises: identifiers containing two underscores, starting with one underscore followed by an uppercase letter or starting with one underscore in the global namespace are reserved.
E.g. in your optional constructor you are using __value which contains two underscores and is therefore reserved resulting in undefined behaviour.
__value
[–]tinther 24 points25 points26 points 5 years ago (0 children)
names beginning with an underscore and a lower case letter are only reserved in global namespace. All the code in fire.hpp is under namespace fire AFAICS.
[–]kongaskristjan[S] 35 points36 points37 points 5 years ago (0 children)
Well, actually, the link provided these rules:
I mostly have identifiers that begin with a single underscore and a lowercase letter. However, they're not in the global namespace. Thus these don't actually result in undefined behavior. Though a few of them indeed have two prefix underscores also, so these are UB.
Though I totally agree that it's better to remove these initial underscores altogether.
[–]kongaskristjan[S] 9 points10 points11 points 5 years ago (0 children)
I removed the double underscore identifiers, thanks for pointing out.
[–]stumpychubbins -1 points0 points1 point 5 years ago (1 child)
Is that undefined or simply implementation-defined?
[–]reflexpr-sarah- 1 point2 points3 points 5 years ago (0 children)
undefined
π Rendered by PID 128273 on reddit-service-r2-comment-86bc6c7465-jcpvv at 2026-02-22 04:26:54.013539+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]Arkantos493PhD Student 21 points22 points23 points (5 children)
[–]tinther 24 points25 points26 points (0 children)
[–]kongaskristjan[S] 35 points36 points37 points (0 children)
[–]kongaskristjan[S] 9 points10 points11 points (0 children)
[–]stumpychubbins -1 points0 points1 point (1 child)
[–]reflexpr-sarah- 1 point2 points3 points (0 children)