Improving on the best example on cppreference
kstocky.github.io·20h·
Discuss: r/cpp
Flag this post

TL;DR

In my opinion, the std::enable_shared_from_this page on cppreference.com has the best example code on the site, to explain what it does. This article is talking about an improvement that can be made to it using C++23’s Explicit object member functions, better known as deducing this. Here’s the godbolt link to the final code!

The best example on cppreference.com

Throughout my many visits to cppreference.com, I have found that most of the documented features…

Similar Posts

Loading similar posts...