Skip to content

Conversation

@PhilipBAdams
Copy link
Contributor

@PhilipBAdams PhilipBAdams commented May 20, 2022

This PR changes the runtime vector type template selection technique from preprocessor to variadic template selection.

The change in approach has a few useful consequences

  1. We still define new enum/type pairs in DefinitionList.h, no need to define in multiple places
  2. When writing the code to be dispatched, we have access to editor language features, and don't need to escape newlines. So it is easier to spot mistakes.
  3. Compile errors give more informative messages about error location (instead of the line where macro is defined)
  4. Nested dispatch is simpler
  5. Less boilerplate code

However, we do have the main disadvantage that the new dispatch method is less intuitive. It may also impact the compile time, and we need to verify it has no performance impact.

@PhilipBAdams PhilipBAdams changed the title (WIP) Try using dispatcher instead of macro (WIP) Use template dispatcher for vectortype choice May 20, 2022
@PhilipBAdams PhilipBAdams marked this pull request as ready for review May 20, 2022 05:45
@PhilipBAdams PhilipBAdams changed the title (WIP) Use template dispatcher for vectortype choice Use template dispatcher for vectortype choice May 20, 2022
@PhilipBAdams PhilipBAdams requested a review from MaggieQi May 20, 2022 05:48
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