Disabling debugging call of weak_from_this for C++ < 17.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-06-19 18:24:36 -07:00 committed by Ralf W. Grosse-Kunstleve
parent bf8d6a2900
commit 20ef96c87d

View File

@ -64,8 +64,11 @@ inline int shared_from_this_status(...) { return 0; }
template <typename AnyBaseOfT> template <typename AnyBaseOfT>
inline int shared_from_this_status(const std::enable_shared_from_this<AnyBaseOfT> *ptr) { inline int shared_from_this_status(const std::enable_shared_from_this<AnyBaseOfT> *ptr) {
#if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
if (ptr->weak_from_this().lock()) return 1; if (ptr->weak_from_this().lock()) return 1;
return -1; return -1;
#endif
return 999;
} }
struct smart_holder; struct smart_holder;