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
This commit is contained in:
Eric Fiselier
2016-06-27 01:02:43 +00:00
parent 5781358757
commit 83d7ca9ea5
4 changed files with 12 additions and 2 deletions

View File

@@ -13,14 +13,20 @@
// {
// public:
// typedef T element_type;
// typedef weak_ptr<T> weak_type; // C++17
// ...
// };
#include <memory>
#include "test_macros.h"
struct A; // purposefully incomplete
int main()
{
static_assert((std::is_same<std::shared_ptr<A>::element_type, A>::value), "");
#if TEST_STD_VER > 14
static_assert((std::is_same<std::shared_ptr<A>::weak_type, std::weak_ptr<A>>::value), "");
#endif
}