Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax the constraints on basic_facade_builder::support_weak #266

Conversation

mingxwa
Copy link
Collaborator

@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 tian-lt and guominrui 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