RCTManagedPointer fix ups

Reviewed By: javache

Differential Revision: D5727367

fbshipit-source-id: ef6c03e57ee0c40da9411c77f0e8a733945afa07
This commit is contained in:
Alex Dvornikov
2017-09-01 07:59:06 -07:00
committed by Facebook Github Bot
parent 3ab973ed80
commit 77c11e831b

View File

@@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifdef __cplusplus
#include <memory>
#import <Foundation/Foundation.h>
@@ -24,11 +26,16 @@
@end
namespace RCT {
template <typename T, typename P>
RCTManagedPointer *managedPointer(P initializer)
{
auto ptr = std::shared_ptr<void>(new T((NSDictionary *)initializer));
return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];
}
namespace facebook {
namespace react {
template <typename T, typename P>
RCTManagedPointer *managedPointer(P initializer)
{
auto ptr = std::shared_ptr<void>(new T(initializer));
return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];
}
} }
#endif