December 2018
Intermediate to advanced
702 pages
20h 9m
English
The following is a list of algorithms that can be used for finding elements in a range:
std::vector<int> v{ 1, 1, 2, 3, 5, 8, 13 }; auto it = std::find(v.cbegin(), v.cend(), 3); if (it != v.cend()) std::cout << *it << std::endl;
std::vector<int> v{ 1, 1, 2, 3, 5, 8, 13 }; auto it = std::find_if(v.cbegin(), v.cend(), [](int const n) {return n > 10; }); if (it != v.cend()) std::cout << *it << std::endl;
Read now
Unlock full access