to_weak_ptr
Summary: [Folly] `to_weak_ptr`. Make a `weak_ptr` and return it from a `shared_ptr` without specifying the template type parameter and letting the compiler deduce it. So you can write this: auto wptr = to_weak_ptr(getSomethingShared<T>()); Instead of this: auto wptr = weak_ptr<T>(getSomethingShared<T>()); Useful when `T` is long, such as: using T = foobar::FooBarAsyncClient; Reviewed By: nbronson Differential Revision: D4361276 fbshipit-source-id: 782a1d2d57b6e5823cb4018e445110098f1ce41f
Showing
Please register or sign in to comment