-
I'm trying to practically use these interfaces. They're great, but it would be even better, if generic math interface had a marker interface. Example:
Advantages:
Disadvantages:
My logic behind it: These interfaces are to be used in generic classes as constraints. The marker interfaces broaden the ability to use them in these scenarios. You can specify that only signed numbers (for example) will be used and specify the exact type down the line of inheritance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 20 replies
-
What is the advantage of the constraint in that case? |
Beta Was this translation helpful? Give feedback.
-
FWIW:
Framework Design Guidelines, 3rd edition, section 4.6 (p 105 in the print edition). So it'd need a whole lot of value to justify going against guidelines. Because of how generic constraints cascade (not well), I don't think there'll be a whole lot of value here. |
Beta Was this translation helpful? Give feedback.
FWIW:
Framework Design Guidelines, 3rd edition, section 4.6 (p 105 in the print edition).
So it'd need a whole lot of value to justify going against guidelines. Because of how generic constraints cascade (not well), I don't think there'll be a whole lot of value here.