I am learning C++ STL and one thing that not sure is how to safely use STL.
For example one thing, I am constantly catching myself is using container, without doing if (!container.empty())
. Seems a trivial thing to do, but is source of bugs.
Are there any rules or guides on how to safely use STL ?
Edit: So far, I found one such guide JSF Air Vehicle - C++ Coding Standards - Joint Strike Fighter
, but it seems to be outdated by now (or at least was not updated, though most rules are applicable to this day)