constexpr int test() {
auto p = std::make_shared<int>(42);
std::weak_ptr<int> w = p;
return *w.lock();
}
static_assert(test() == 42);
unique_ptr went constexpr in C++23
shared_ptr waited until C++26 🧵👇
Our mission is to make the C++ programming language accessible and useful to anyone who wishes to learn and apply the language.

