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

Revise semantics of proxiable_ptr_constraints #127

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

mingxwa
Copy link
Collaborator

@mingxwa mingxwa commented Jul 8, 2024

Changes

  • Updated the requirements of constraint_level::trivial in proxiable_ptr_constraints from std::is_trivially_copy_constructible_v<T> into std::is_trivially_copy_constructible_v<T> && std::is_trivially_destructible_v<T> to align with the definition of std::is_trivially_copyable.
  • In class template proxy<F>, removed proxy::proxy(const proxy&) = delete, proxy::proxy(proxy&&) = delete, proxy& proxy::operator=(const proxy&) = delete, proxy& proxy::operator=(proxy&&) = delete and proxy::~proxy() = delete since they are no longer needed.
  • In class template proxy<F>, when F::constraints::copyability == constraint_level::trivial, proxy(proxy&&) and proxy& operator=(proxy&&) are no longer defined, so that move constructions and move assignments can fall back to trivial implementations of proxy(const proxy&) noexcept = default and proxy& operator=(const proxy&) noexcept = default.
  • In class template proxy<F>, merged proxy& operator=(const proxy&) and proxy& operator=(const proxy&) noexcept; merged proxy& operator=(P&& ptr) and proxy& operator=(P&& ptr) noexcept.
  • Moved friend function swap from proxy<F> into global namespace pro and removed the requires clause.
  • Explicitly declared return types of function template access_proxy.
  • Updated sample code for resource dictionary.
  • Updated unit tests accordingly.

@mingxwa mingxwa added this to the P3086R3 milestone Jul 8, 2024
@mingxwa mingxwa requested review from tian-lt and guominrui July 8, 2024 14:14
@mingxwa mingxwa self-assigned this Jul 8, 2024
@mingxwa mingxwa merged commit ac827f7 into microsoft:main Jul 9, 2024
4 checks passed
@mingxwa mingxwa deleted the user/mingxwa/refactor branch July 9, 2024 11:35
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