[PATCH] D70754: [libcxx] Add support for std::reinterpret_pointer_cast

mupp via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 22:00:41 PST 2020


MU001999 updated this revision to Diff 239229.
MU001999 added a comment.

Fix `UP` to `Up`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70754/new/

https://reviews.llvm.org/D70754

Files:
  include/memory


Index: include/memory
===================================================================
--- include/memory
+++ include/memory
@@ -4629,6 +4629,12 @@
     return shared_ptr<_Tp>(__r, const_cast<_RTp*>(__r.get()));
 }
 
+template<class _Tp, class _Up>
+shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT
+{
+    return shared_ptr<_Tp>(__r, reinterpret_cast<_Tp*>(__r.get()));
+}
+
 #ifndef _LIBCPP_NO_RTTI
 
 template<class _Dp, class _Tp>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70754.239229.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200121/56d006bd/attachment.bin>


More information about the llvm-commits mailing list