4 ms·
You can if you know all of the possible types in advance. But if you want to expose this as an interface from a library that allows users to provide their own c
by nicoburns 4y ago
You can if you know all of the possible types in advance. But if you want to expose this as an interface from a library that allows users to provide their own custom implementation then you need to use traits.