Skip to content

Function params: use constraint to enforce length, template specialisation for default case - #68

Merged
garethpotter merged 3 commits into
mainfrom
named-params-use-requires-not-static-assert
Aug 4, 2026
Merged

Function params: use constraint to enforce length, template specialisation for default case#68
garethpotter merged 3 commits into
mainfrom
named-params-use-requires-not-static-assert

Conversation

@garethpotter

@garethpotter garethpotter commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator
  • requires is a bit more modern
  • we can use template specialisation to do the default empty case rather than needing an if/else (and a separate count check)

@garethpotter
garethpotter requested a review from amitchone August 4, 2026 14:27
@amitchone

Copy link
Copy Markdown
Collaborator

Nice to see you! Yeah, agreed, this is a nicer way to implement. Appreciate the input as always

@garethpotter garethpotter changed the title Use C++20 constraint rather than static_assert to ensure correct number of param names Function params: use constraint to enforce length, template specialisation for default case Aug 4, 2026
@garethpotter
garethpotter merged commit 57a0ff9 into main Aug 4, 2026
6 checks passed
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