JLospinoso / ccc

Companion Code for C++ Crash Course
https://ccc.codes
GNU General Public License v3.0
377 stars 105 forks source link

Typo: Page no. 577 - any_of algorithm description #186

Closed vaibspider closed 3 years ago

vaibspider commented 3 years ago

On page no. 577, in the any_of algorithm description, following sentence is present.

The algorithm returns false if the target sequence is empty or if pred is true for any element in the sequence; otherwise, it returns false

Instead of false(highlighted above), it should be true.

dascandy commented 3 years ago

any_of returns false if the sequence is empty: https://en.cppreference.com/w/cpp/algorithm/all_any_none_of

The sentence can be reworded to be clearer, that's true.