Re:Why would you learn C++ in 2016?
by wtetzner on Wednesday April 13, 2016 @09:10AM
(#11487802)
Yes, you're right. The only way I can think of to handle it (in Scala, I suppose you can't do it in Rust) would be via implicit parameters. You would basically have a Times trait, and a TimesOp trait.
I'm sure I got something wrong here, but I think the basic idea works. In any case, it goes to show that getting this behavior in a language with strongly-typed generics is non-trivial.
[ Parent
| on HN ]
There are no comments on this comment yet.