Timeline for Storing function metadata
Current License: CC BY-SA 4.0
3 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 16, 2020 at 23:00 | comment | added | butt |
A tuple of types as the signature would require the Function class to be templated (and heterogenous). It could work but it would need to inherit from some base class if you wanted to store them in a container, and it would generate a new set of validation code per function signature. Otherwise a list of enums is fine, you could loop over them and switch on the enum value, testing the argument type using std::holds_alternative
|
|
| Jan 16, 2020 at 21:55 | comment | added | Quest |
I totally agree with all the above, but I didn't want this question to be about such things but rather how to store that information in a more viable manner. - Something like std::tuple with checks whether an array of variants have the same type as std::tuple variadic parameters in that order
|
|
| Jan 16, 2020 at 21:46 | history | answered | butt | CC BY-SA 4.0 |