Skip to content

Conversation

@halleysfifthinc
Copy link
Contributor

My ultimate goal when beginning this PR was to add developer hints in the form of static_asserts to catch missed SuperType specializations (as mentioned in my last PR). I didn't get that far in this PR, but it has some helpful changes anyways. I started by working to understand (and then simplifying if possible) the metaprogramming utilities related to wrapping parametric types (e.g. apply_combination, etc). As a result, the commits in this PR are not all related, but they are all atomic (with one exception), so I can split this up if/as much as you want (or drop the more style based commits).

  • I found a several cases where I was able to use more modern C++ type-trait features to reduce verbosity and improve readability IMO (e.g. std::is_same_v<T,U> instead of std::is_same<T,U>::value, etc). (The README says C++17 is the minimum required, but the CMake configuration actually requires C++20.)
  • RemoveDuplicates, CombineTypes, and DoApply and ForEachType were all simplified to avoid or reduce the amount of recursion by using fold expressions.
    • I don't think the simplification with fold expressions for DoApply and ForEachType in 2ecb670 works without the CombineTypes refactor.
  • Missing constexpr added to two if branches conditioned on a type-trait
  • Some dead code was removed

@barche barche merged commit bdf5c80 into JuliaInterop:main Dec 25, 2025
11 checks passed
@barche
Copy link
Contributor

barche commented Dec 25, 2025

Many thanks for this, it's a great improvement!

@halleysfifthinc halleysfifthinc deleted the simplify_metaprogramming branch December 29, 2025 19:24
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.

2 participants