Skip to content

Conversation

@mingxwa
Copy link
Member

@mingxwa mingxwa commented Mar 4, 2025

Before this change, only std::shared_ptr and the return type of (allocate|make)_proxy() can instantiate a proxy<F> if F was built with support_weak. The constraints can be relaxed since std::shared_ptr has a member type weak_type. After this change, any pointer type that has implemented a weak_type can work with support_weak.

@mingxwa mingxwa requested review from guominrui and tian-lt March 4, 2025 06:05
@mingxwa mingxwa marked this pull request as ready for review March 4, 2025 06:47
@mingxwa mingxwa merged commit 28992ec into microsoft:main Mar 4, 2025
7 checks passed
@mingxwa mingxwa deleted the user/mingxwa/allow-custom-weak-implementation branch March 4, 2025 06:51
template <class P>
auto operator()(const P& self) const noexcept
requires(requires { typename P::weak_type; } &&
std::is_convertible_v<const P&, typename P::weak_type>)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding lock() as a requirement as well?

@mingxwa mingxwa mentioned this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants