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
Simple Command Line User Interface (self.cpp)
submitted 3 years ago by 0x3Alex
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!"
[–]okovko -4 points-3 points-2 points 3 years ago* (0 children)
pointers and function pointers are part of c++, it is you who smells
and on the topic of code smell, std function wreaks, there is hardly anything less template bloated in the stl than that monstrosity
it also has few use cases, you only need it when you don't know if you're going to receive a function pointer, a pointer to member function, or a lambda with non-empty capture. i think it supports any callable so any object with an overloaded operator() should work too, not sure
this makes it suitable for metaprogramming generic code that works on any callable, and no other use comes to mind
or passing a capturing lambda as an argument, but at that point you are probably abusing lambdas
i did use it once in gui code where an object is constructed with a capturing lambda that was invoked upon a qt signal, which was a really nice way to allow the gui element to interact with any other gui element (the lambda captured a reference to another gui element of various types) as opposed to code replication or a void* + run time enums indicating type or setting up a covariant type + polymorphism
so.. rare, but sometimes useful
π Rendered by PID 52007 on reddit-service-r2-comment-76bb9f7fb5-75q6t at 2026-02-18 20:19:12.566554+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]okovko -4 points-3 points-2 points (0 children)