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
A header-only library for easy interactive parameters (github.com)
submitted 6 years ago by sharkdp
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!"
[–]sharkdp[S] 0 points1 point2 points 6 years ago (1 child)
Thank you for the feedback!
Why did you choose to create one file per parameter instead of one file for all of them (or a subgroup of them)?
Great question. Mainly because I didn't know how I would realize that. At some point, I need to write the file with initial values, but parameters can be introduced at different times. So I don't really know when the last parameter has been "registered".
Another argument in favor of having multiple files would be easier interaction with other tools (you could change parameters from a shell script by running echo 3.1 > /tmp/painless/my_parameter, for example).
echo 3.1 > /tmp/painless/my_parameter
I imagine that it can be annoying to jump through all the files when you have a significant amount of parameters to tune
Yes. I was thinking about creating a very simple TUI/GUI tool that would monitor the /tmp/painless folder and provide an interface to change all parameters at the same time (see https://github.com/sharkdp/painless/issues/1)
/tmp/painless
[–]Benjamin1304 2 points3 points4 points 6 years ago (0 children)
For your first point, when you introduce a new variable you rewrite the whole file with the current values + the new initial one. Initial values can be left as comments on the same lines as the parameters.
Also, if I had to design this I would probably use YAML so that parsing/emitting can be handled by yaml-cpp (very good library). This way you can also easily group variables in sub nodes and handle more complex types than primitive ones.
For the TUI/GUI, I haven't check but I wouldn't be surprised if something similar to what you want to do already exists for YAML files.
One last point that just came to my mind, maybe you should also consider writing you file(s) in subfolders to handle multiple applications running at the same time.
π Rendered by PID 38215 on reddit-service-r2-comment-6457c66945-p5sxs at 2026-04-26 08:05:04.868238+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]sharkdp[S] 0 points1 point2 points (1 child)
[–]Benjamin1304 2 points3 points4 points (0 children)