Search⌘ K

Conventions

Explore the conventions and rules for using C++ standard library algorithms to efficiently manipulate container elements. Understand key headers involved, naming suffixes like _if and _copy, and iterator type conventions. This lesson helps you write clearer and correct algorithm calls by grasping these foundational rules.

We'll cover the following...

To use the algorithms, we have to keep a few rules in our mind.

Headers

The algorithms are defined in various headers:

Names Description
<algorithm> Contains the general algorithms.
<numeric> Contains numeric algorithms.
<functional> Predefined function objects and function adapters.

Name Conventions

Many of the algorithms have the name suffix _if and _copy.

Names Description
...