static_function_deleter.
Summary: [Folly] static_function_deleter. So you can write this: using BIO_deleter = folly::static_function_deleter<BIO, &BIO_free>; auto buf = std::unique_ptr<BIO, BIO_deleter>(BIO_new(BIO_s_mem())); buf = nullptr; In place of this: struct BIO_deleter { void operator()(BIO* bio) { BIO_free(bio); } }; auto buf = std::unique_ptr<BIO, BIO_deleter>(BIO_new(BIO_s_mem())); buf = nullptr; Reviewed By: @alandau Differential Revision: D2364544
Showing
Please register or sign in to comment