[PATCH] D70754: [libcxx] Add support for std::reinterpret_pointer_cast
mupp via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 16:46:19 PST 2019
MU001999 created this revision.
MU001999 added a reviewer: libc++.
MU001999 added a project: libc++.
Herald added a reviewer: EricWF.
Herald added subscribers: llvm-commits, ldionne.
Herald added a reviewer: mclow.lists.
Herald added a project: LLVM.
Add the implementation of std::reinterpret_pointer_cast <https://en.cppreference.com/w/cpp/memory/shared_ptr/pointer_cast>.
Repository:
rG LLVM Github Monorepo
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.231149.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191127/9a03a6f8/attachment.bin>
More information about the llvm-commits
mailing list