Skip to content

Commit f5471cf

Browse files
committed
Restoring backcompat makeStrong versions since these are useful on their own
1 parent a26b102 commit f5471cf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

include/objc-helpers/BlockUtil.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,21 @@ namespace BlockUtil
639639
auto makeStrong(WeakHolder<R (Args...)> holder) -> R (^)(Args...)
640640
{ return holder.obj; }
641641

642+
643+
/**
644+
Convert weak pointer to a strong pointer of the same type
645+
*/
646+
template<class T>
647+
auto makeStrong(T * __weak obj) -> T *
648+
{ return obj; }
649+
650+
/**
651+
Convert weak block pointer to a strong pointer of the same type
652+
*/
653+
template<class R, class... Args>
654+
auto makeStrong(R (^ __weak obj)(Args...)) -> R (^)(Args...)
655+
{ return obj; }
656+
642657
#endif
643658

644659
}

0 commit comments

Comments
 (0)