Traits classes are very powerful. They allow to associate information and functionality with arbitrary classes in a non-intrusive way. This makes it possible to use any type in a certain template as long as all access is done through the traits and there is an appropriate specialization.
The default specialization often just forwards to a member function. But for some functionality the types don’t necessarily need to provide it, it’s optional. Then the traits define a default implementation that is used as a fallback. In this post, I will show you how to implement such traits classes.» read more »