Skip to content

Incorrect example code F.1 #1928

@oliveriobw

Description

@oliveriobw

version: April 10, 2022

F.1: “Package” meaningful operations as carefully named functions

The named lambda example usage example is wrong. A binary predicate lambda is defined:

auto lessT = [](T x, T y) { return x.rank() < y.rank() && x.value() < y.value(); };

First usage is fine:

sort(a, b, lessT);

Second usage would need a unary predicate:

find_if(a, b, lessT);

Suggest removing the find_if usage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions