[defns.projection] (original) (raw)

3 Terms and definitions [intro.defs]

3.44[defns.projection]projection

⟨library⟩ transformation that an algorithm applies before inspecting the values of elements

[Example 1:

std::pair<int, std::string_view> pairs[] = {{2, "foo"}, {1, "bar"}, {0, "baz"}}; std::ranges::sort(pairs, std::ranges::less{}, [](auto const& p) { return p.first; });sorts the pairs in increasing order of their first members:{{0, "baz"}, {1, "bar"}, {2, "foo"}}

— _end example_]