Classes and class hierarchies
C.101
Give a container value semantics
Reason
Regular objects are simpler to think and reason about than irregular ones. Familiarity.
Note
If meaningful, make a container Regular (the concept). In particular, ensure that an object compares equal to its copy.
Example
void f(const Sorted_vector<string>& v)
{
Sorted_vector<string> v2 {v};
if (v != v2)
cout << "Behavior against reason and logic.\n";
// ...
}
Enforcement
???