this post was submitted on 04 Aug 2023
6 points (100.0% liked)
C++
1791 readers
2 users here now
The center for all discussion and news regarding C++.
Rules
- Respect instance rules.
- Don't be a jerk.
- Please keep all posts related to C++.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Well, you can't exactly have required parameters that way. At keast not to my knowledge
I'm sure you can come up with some utility class
required
(templated withT
, Lemmy won't let me) that isn't default constructible but can be implicitly constructed from aT
, then use this instead of typeT
in the struct definition.