Modeling Typeclasses in C ++

Is it possible to implement cool Haskell classes in C ++? If so, how?

+7
c ++ functional-programming haskell typeclass
source share
2 answers

Here are some articles about this that may be useful as background reading:

+7
source share

A similar mechanism in C ++ is called "concepts." The idea is to define a class defining requirements of any type belonging to this class. C ++ iterators make extensive use of concepts, and C ++ 0x was intended to support direct syntax for them (rather than indirect template tricks to perform the conceptual checks that C ++ currently uses), but it looks like this support has been removed from standard.

+3
source share

All Articles