Skip to content

Conversation

@mingxwa
Copy link
Member

@mingxwa mingxwa commented Jun 26, 2024

Changes

  • Revised the semantics of accessor. Let accessors defined in a dispatch be aware of the overload types to generate better APIs. This also improves diagnostics and code completion from a modern IDE. Invoking a proxy will no longer cause confusion in IntelliSense (tested with the latest version of Visual Studio and VS Code). Resolves Unexpected intellisense error message in VS2022 #103
  • Revised the design of operator dispatches. Previously, operator dispatches are defined as "prefix" and "postfix". After this change, this concept no longer applies because some operators (specifically, +, -, ++, --, * and &) requires the operator be defined in a same type to avoid ambiguity. Therefore, we have decided to divide the definition of operator dispatches in a new way: whether it applies to left-hand-side operand (LHS) or right-hand-side operand (RHS). As a result, for most cases (except for the 6 operators mentioned above), PRO_DEF_POSTFIX_OPERATOR_DISPATCH is replaced by PRO_DEF_LHS_OPERATOR_DISPATCH; PRO_DEF_PREFIX_OPEATOR_DISPATCH is replaced by PRO_DEF_RHS_OPERATOR_DISPATCH.
  • Added __declspec(empty_bases) for MSVC to improve code generation for accessors. Covered by unit tests. Resolves Having two or more indirect conventions will make proxy 8 bytes larger than expected in MSVC #123
  • Implemented RHS version of 9 assignment operators (+=, -=, *=, /=, &=, |=, ^=, <<=, >>=), which was missing before this change. Covered by unit tests.

@mingxwa mingxwa added this to the P3086R3 milestone Jun 26, 2024
@mingxwa mingxwa requested review from guominrui and tian-lt June 26, 2024 15:19
@mingxwa mingxwa self-assigned this Jun 26, 2024
@mingxwa mingxwa merged commit 9636e15 into microsoft:main Jun 27, 2024
@mingxwa mingxwa deleted the user/mingxwa/params branch June 27, 2024 04:56
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.

Having two or more indirect conventions will make proxy 8 bytes larger than expected in MSVC Unexpected intellisense error message in VS2022

2 participants