Closed Od0VxibTqto6Hs closed 11 months ago
TDLib has multiple incompatibilities with C++20 and currently is supposed to be built with a C++14 compiler as specified in CMakeLists.txt.
This function was deprecated in C++17 and removed in C++20 because use_count is only an approximation in multithreaded environment.
And our use case was perfectly legitimate, because we just check that only the current thread owns the shared pointer before completely destroying it. It was a sanity check, which is now harder to implement in C++20.
TDLib has multiple incompatibilities with C++20 and currently is supposed to be built with a C++14 compiler as specified in CMakeLists.txt. ...
Thanks for your reply and provide the information.
Summary
Tdlib failed to build with
error C2039: 'unique': is not a member of 'std::shared_ptr<td::SqliteConnectionSafe>'
on/std:c++20
option.This function was deprecated in C++17 and removed in C++20 because use_count is only an approximation in multithreaded environment.
https://en.cppreference.com/w/cpp/memory/shared_ptr/unique https://learn.microsoft.com/en-us/cpp/standard-library/shared-ptr-class?view=msvc-170#unique
Additional Option
Error Info
Related Code
https://github.com/tdlib/td/blob/a7f8ff6eefbb4951d62b9e29bc4f7b95a28a46f0/td/telegram/TdDb.cpp#L277 https://github.com/tdlib/td/blob/a7f8ff6eefbb4951d62b9e29bc4f7b95a28a46f0/td/telegram/TdDb.cpp#L320 https://github.com/tdlib/td/blob/a7f8ff6eefbb4951d62b9e29bc4f7b95a28a46f0/td/telegram/TdDb.cpp#L322