XCode 15.3 throws error about std::adopt_lock

Hi there,

March 11, 2024, I was asked to update libraries when launching XCode, then I always got following errors in compiling my project which was built fine yesterday. The related file has not been changed for over 5 years.

Application/Utils/SmartPointers/CountedPtr.h:86:49 No member named 'adopt_lock' in namespace 'std'

#include <mutex>

    inline CountedPtr(const CountedPtr<T>& countedPtr) throw() {
		std::lock(mu,countedPtr.mu);
		std::lock_guard<std::mutex> self_lock(mu,std::adopt_lock);
		std::lock_guard<std::mutex> other_lock(countedPtr.mu,std::adopt_lock);
		ptr = std::move(countedPtr.ptr);
		refCount = std::move(countedPtr.refCount);
		++*refCount;
     }

It is strange that ONLY "std::adopt_lock" is complained.

Anyone has the same issue? How to solve it?

Thanks, Feng

XCode 15.3 throws error about std::adopt_lock
 
 
Q