summaryrefslogtreecommitdiffstats
path: root/libcxx/include/memory
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-06-27 01:02:43 +0000
committerEric Fiselier <eric@efcs.ca>2016-06-27 01:02:43 +0000
commit68436a9b488b976f811dd2dc2c5dba078bd9427b (patch)
tree65079ab98ddf09f4708d776d277a5dc908e0bbfe /libcxx/include/memory
parent8b7faa68716d8c65ffad76b2594684a41aeb4c62 (diff)
downloadbcm5719-llvm-68436a9b488b976f811dd2dc2c5dba078bd9427b.tar.gz
bcm5719-llvm-68436a9b488b976f811dd2dc2c5dba078bd9427b.zip
Implement P0163r0. Add shared_ptr::weak_type.
This patch adds the weak_type typedef in shared_ptr. It is available in C++17 and newer. This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to have the value of 16, since 2016 is the current year. llvm-svn: 273839
Diffstat (limited to 'libcxx/include/memory')
-rw-r--r--libcxx/include/memory4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 47963e08a0c..50a1f00a5e5 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -361,6 +361,7 @@ class shared_ptr
{
public:
typedef T element_type;
+ typedef weak_ptr<T> weak_type; // C++17
// constructors:
constexpr shared_ptr() noexcept;
@@ -3863,6 +3864,9 @@ class _LIBCPP_TYPE_VIS_ONLY shared_ptr
{
public:
typedef _Tp element_type;
+#if _LIBCPP_STD_VER > 14
+ typedef weak_ptr<_Tp> weak_type;
+#endif
private:
element_type* __ptr_;
__shared_weak_count* __cntrl_;
OpenPOWER on IntegriCloud