mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
Disabling debugging call of weak_from_this
for C++ < 17.
This commit is contained in:
parent
bf8d6a2900
commit
20ef96c87d
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user