How to run action for the struct which is a parent of the other #194
-
The title may seem strange, so let me give an example.
The program prints |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The short answer is: You can't. It's a limitation of the language, as the specialization does not work for direct base classes. As a work-around you may simply avoid deriving directly and instead use a
it should work. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the fast answer! |
Beta Was this translation helpful? Give feedback.
The short answer is: You can't. It's a limitation of the language, as the specialization does not work for direct base classes.
As a work-around you may simply avoid deriving directly and instead use a
seq
as a wrapper. If you useit should work.