3 ms·
C++20 introduced concepts, and now it's possible to specify type constraints, like integral, in a way similar to Haskell typeclasses. What it doesn't solve tha
by srg0 6y ago
C++20 introduced concepts, and now it's possible to specify type constraints, like integral, in a way similar to Haskell typeclasses.
What it doesn't solve that by default the compiler tries to find an appropriate implicit conversion. Sometimes it's convenient, sometimes it's harder to see what the code actually does.
- eru 6y agoYes, concepts help a bit, but I'm not sure whether they would be necessary here. Yes, the implicit conversion for all values is part of the problem. The Haskell approach only gives you magic for literals.