Value class, such as std::pair, std::vector, std::string.
Has a public destructor, copy ctor and assignment with value
semantics
Has no virtual function. so intended to be used as a concrete
class, not as a base class.
instantiated on stack or as a member of an other class.
Base class.
Has a destructor that is public and virtual, But for
some trait class, destructor can be protected, such as
std::unary_function
Establish interface.
Usually instantiated on heap, and used via a (smart) pointer
or reference to support polymorphism.
Trait class.
Contain only typedef and static functions, It has no modifiable
state.
Is not instantiated( ctor is private or disable)
Usually instantiated on heap, and used via a (smart) pointer.
Policies are classes (or class templates) to inject behavior into a parent
class, typically through inheritance. Through decomposing a parent interface
into orthogonal (independent) dimensions, policy classes form the building
blocks of more complex interfaces. An often seen pattern is to supply
policies as user-definable template (or template-template) parameters with a
library-supplied default. An example from the Standard Library are the
Allocators, which are policy template parameters of all STL containers
Traits are class templates to extract properties from a generic type. There
are two kind of traits: single-valued traits and multiple-valued traits. Examples
of single-valued traits are the ones from the header <type_traits>.
Single-valued traits are often used in template-metaprogramming and
SFINAE tricks to overload a function template based on a type condition.