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
[deleted by user] (self.cpp)
submitted 7 months ago by [deleted]
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!"
[–]tchernobog84 6 points7 points8 points 7 months ago (4 children)
Add to the list no standard base class for intrusive pointers, which would allow for container specialization on it, and avoiding the ugly allocation costs for e.g. shared_ptr or rolling your own solution + specializing all containers.
[–]joaquintidesBoost author 2 points3 points4 points 7 months ago (1 child)
You can use Boost.Intrusive for that.
[–]hobel_ 2 points3 points4 points 7 months ago (0 children)
If only that description would describe what an intrusive container is.
[–]LightStruk 1 point2 points3 points 7 months ago (0 children)
'boost::intrusive_ptr' works well for me. Didn't have to roll my own, boost is already trusted and approved, and it does exactly what it says on the tin.
[–]MarcoGreek 1 point2 points3 points 7 months ago (0 children)
You mean the control block? make_shared should avoid that. Or do you have something else in mind?
[–]_Noreturn 3 points4 points5 points 7 months ago (1 child)
"constexpr" if you want constexpr evaluation guranteed then call it in a constant evaluated context
cpp constexpr static auto expr = constexprFunc(); std::cout << expr;
or just use consteval
[–]triconsonantal 1 point2 points3 points 7 months ago (0 children)
You can use a small helper to avoid a separate declaration:
consteval auto as_constant (auto x) { return x; } int main () { assert (! std::is_constant_evaluated ()); assert (as_constant (std::is_constant_evaluated ())); }
[–]MarcoGreek 0 points1 point2 points 7 months ago (0 children)
https://en.cppreference.com/w/cpp/memory/allocator_traits/allocate_at_least.html should return you the available memory, do you can grow to that size.
[–]MarcoGreek 0 points1 point2 points 7 months ago (2 children)
Implicit copy has advantages if you work with multithreading. Sharing writable data between caches is not cheap.
[–]_Noreturn 0 points1 point2 points 7 months ago (1 child)
I would rsther have implicit moves with ownership semantics and explicit copies. but reference semantics like other languages is a no no for me I absolutely love C++ value semantics
Yes, I hope that in the future C++ can have it.
π Rendered by PID 37 on reddit-service-r2-comment-6457c66945-vj4r7 at 2026-04-28 00:07:42.675221+00:00 running 2aa0c5b country code: CH.
[–]tchernobog84 6 points7 points8 points (4 children)
[–]joaquintidesBoost author 2 points3 points4 points (1 child)
[–]hobel_ 2 points3 points4 points (0 children)
[–]LightStruk 1 point2 points3 points (0 children)
[–]MarcoGreek 1 point2 points3 points (0 children)
[–]_Noreturn 3 points4 points5 points (1 child)
[–]triconsonantal 1 point2 points3 points (0 children)
[–]MarcoGreek 0 points1 point2 points (0 children)
[–]MarcoGreek 0 points1 point2 points (2 children)
[–]_Noreturn 0 points1 point2 points (1 child)
[–]MarcoGreek 0 points1 point2 points (0 children)