google-research / raksha

Apache License 2.0
35 stars 17 forks source link

Move the implementation of make_intrusive_ptr as a static factor method of the intrusive_ptr class. #868

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Move the implementation of make_intrusive_ptr as a static factor method of the intrusive_ptr class.

This makes it easy to declare intrusive_ptr as a friend method (if needed) of a class whose constructor is private. Otherwise, we will have to add the global template function as a friend which is not quite pleasant.