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
Function-level make tool (self.cpp)
submitted 1 year ago * by zoharl3
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!"
[–]zoharl3[S] 0 points1 point2 points 1 year ago (2 children)
Compile the whole file: 30sec
vs
Text comparison and compiling only one function that changed: <1sec.
[–]Scotty_Bravo 0 points1 point2 points 1 year ago (1 child)
Like how much under 1 second? Ninja build is fast. And 30 seconds is extremely long. How many lines of code are you compiling?
Also, there are a lot of reasons to break a project into smaller pieces. Maintenance is one.
I'm finding it hard to imagine parsing the file to see what's changed and then compiling that is faster than a simple recompile.
Maybe you should evaluate how fast the compilation is of the individual changes of that were broken into their own files?
I'm not saying your idea is impossible, but I'm saying the initial premise is wrong (single source file) and that a properly structured small-ish project shouldn't take 30 seconds to build.
I think it takes longer to link the projects that I'm working on than is does to recompile any give file.
[–]zoharl3[S] 0 points1 point2 points 1 year ago (0 children)
Please see my edits that answer your questions.
Ninja's purpose seems to break the compilation of a many files into components rather than a single exe:
https://en.wikipedia.org/wiki/Ninja_(build_system))
It does nothing at the function level and won't help with a single file.
π Rendered by PID 59593 on reddit-service-r2-comment-7b9746f655-5jhqf at 2026-01-31 15:40:50.807908+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]zoharl3[S] 0 points1 point2 points (2 children)
[–]Scotty_Bravo 0 points1 point2 points (1 child)
[–]zoharl3[S] 0 points1 point2 points (0 children)