Minimal Requirements for Inclusion in an STL Container


To store an object in any STL container, the object must provide a minimal required public interface. Variations in use of the container can require additional interface members.

The minimal set of required interfaces to an object for inclusion in an STL container are listed below.

Although a default constructor is not strictly necessary, it may be required due to a common compiler defect.

Additionally, if you wish to sort or compare containers using the default comparators (== and <), the class must include the operators listed below. Even if you do not actually use the relational operators, adding them is recommended because some compilers try to compile them anyway.


Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.