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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273839 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__config b/include/__config
index e28fc5d..bb36244 100644
--- a/include/__config
+++ b/include/__config
@@ -756,7 +756,7 @@
# elif __cplusplus <= 201402L
# define _LIBCPP_STD_VER 14
# else
-# define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification
+# define _LIBCPP_STD_VER 16 // current year, or date of c++17 ratification
# endif
#endif // _LIBCPP_STD_VER
diff --git a/include/memory b/include/memory
index 47963e0..50a1f00 100644
--- a/include/memory
+++ b/include/memory
@@ -361,6 +361,7 @@
{
public:
typedef T element_type;
+ typedef weak_ptr<T> weak_type; // C++17
// constructors:
constexpr shared_ptr() noexcept;
@@ -3863,6 +3864,9 @@
{
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_;