Transforming std::find into std::ranges::find -- Christopher Di Bella

Today, we dive into what std::find does, and how we can leverage various concepts to cleanly express its requirements, as achieved in std::ranges::find.

Transforming std::find into std::ranges::find

By Christopher Di Bella

From the article:

... The code is nearly the same, but not quite. Where it differs is in how we determine the end of the sequence, how we take the successor of our current element, and how we retrieve the value. While this is conceptually the same, it’s implementationally different.

...

Iterators are a topic rich with mathematics. Because they are part of what makes generic programming so powerful, this topic spans multiple chapters in books on generic programming.

...

we’ll now refine find to consider the EqualityComparableWith concept that we laboured over in the last article....

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.