to_shared_ptr.
authorYedidya Feldblum <yfeldblum@fb.com>
Fri, 26 Jun 2015 06:11:30 +0000 (23:11 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 26 Jun 2015 18:45:40 +0000 (11:45 -0700)
commit9b980c759b403c14ae34a74a060ad8a1ec7962b0
tree28ffd4c7fffd537c43699868897d9140fa8486e9
parent06557e1f06b3eaea99e0f32406e5a6989354b8bf
to_shared_ptr.

Summary: [Folly] to_shared_ptr.

So you can write this:

    auto sptr = to_shared_ptr(getSomethingUnique<T>());

Instead of this:

    auto sptr = shared_ptr<T>(getSomethingUnique<T>());

Useful when `T` is long, such as `T = foobar::cpp2::FooBarServiceAsyncClient`.

Reviewed By: @meyering

Differential Revision: D2193572
folly/Memory.h
folly/test/MemoryTest.cpp