
Enforcing Compile-time Constraints
eneric containers and algorithms often impose certain restrictions on the objects that they manipulate. For example, the std::sort() algorithm requires that the elements on which it operates shall define the < operator. Enforcing this constraint is easy: the compiler tries to invoke this operator for the given type. If such