News for hackers. Stuff that matters.
Re:Haskell Typeclasses vs. C++ Classes by gpderetta on Wednesday October 18, 2017 @08:04AM (#15498371)
it is not nitpicking, you are correct to point it out. The only difference is where the vtable is attached to: pointers in Haskell, objects instances in c++.

Although the language does not offer a builtin syntax for it, in C++ is also common to attach the 'vtable' to the 'handle' (a smart pointer or deep copying envelope), in the case of type erased wrappers (std::function, std::any, etc).

There are no comments on this comment yet.