Skip to content

Conversation

@leekillough
Copy link
Contributor

@leekillough leekillough commented Nov 25, 2025

Use std::common_type_t to simplify the comparison of different variable types. If a common type exists for which both operands can be explicitly converted to, then you convert them to this common type and perform the comparison on this common type.

  • Note: std::common_type_t<std::bitset<N>::reference, bool> = bool and std::common_type_t<std::vector<bool>::reference, bool> = bool.
  • std::common_type<T1, T2> is the only <type_traits> class which can have user-defined specializations, as long as at least T1 or T2 is a user-defined type, but I did not need to define a specialization.

Use the same cmp() function which uses std::common_type_t for both variable change-detection as well as regular comparisons.

@github-actions github-actions bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CLANG-FORMAT PASS and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Nov 25, 2025
@github-actions
Copy link

CLANG-FORMAT TEST - PASSED

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants