Trying again, to get around unused parameter warnings-as-erros.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-06-19 18:33:02 -07:00 committed by Ralf W. Grosse-Kunstleve
parent 20ef96c87d
commit 993613d9bf

View File

@ -63,13 +63,16 @@ namespace memory {
inline int shared_from_this_status(...) { return 0; } 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) {
#if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912) #if defined(__cpp_lib_enable_shared_from_this) && (!defined(_MSC_VER) || _MSC_VER >= 1912)
inline int shared_from_this_status(const std::enable_shared_from_this<AnyBaseOfT> *ptr) {
if (ptr->weak_from_this().lock()) return 1; if (ptr->weak_from_this().lock()) return 1;
return -1; return -1;
#endif }
#else
inline int shared_from_this_status(const std::enable_shared_from_this<AnyBaseOfT> *) {
return 999; return 999;
} }
#endif
struct smart_holder; struct smart_holder;