From 5bb38c10b3039099080304f66146675f2d688486 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 14 Jun 2021 15:00:10 -0700 Subject: [PATCH] MSVC 2015 compatibility. --- tests/test_class_sh_shared_from_this.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_class_sh_shared_from_this.cpp b/tests/test_class_sh_shared_from_this.cpp index 09fdbff12..a021d4e42 100644 --- a/tests/test_class_sh_shared_from_this.cpp +++ b/tests/test_class_sh_shared_from_this.cpp @@ -112,7 +112,9 @@ struct RescuingDeleter { explicit RescuingDeleter(PyWrapper *pyw) : pyw{pyw} {} void operator()(ToBeWrapped *raw_ptr) { if (pyw->self.get() != nullptr) { +#if !defined(_MSC_VER) || _MSC_VER >= 1912 assert(raw_ptr->weak_from_this().expired()); // CRITICAL +#endif pyw->wobj = std::shared_ptr(raw_ptr, *this); pyw->self.reset(); } else {