About 436 results
Open links in new tab
  1. <algorithm> - C++ Users

    The header <algorithm> defines a collection of functions especially designed to be used on ranges of elements. A range is any sequence of objects that can be accessed through …

  2. C++

    // sort algorithm example #include <iostream> // std::cout #include <algorithm> // std::sort #include <vector> // std::vector bool myfunction (int i,int j) { return (i<j); } struct myclass { bool operator() …

  3. for_each - C++ Users

    template<class InputIterator, class Function> Function for_each(InputIterator first, InputIterator last, Function fn) { while (first!=last) { fn (*first); ++first; } return fn; // or, since C++11: return …

  4. generate - C++ Users

    // generate algorithm example #include <iostream> // std::cout #include <algorithm> // std::generate #include <vector> // std::vector #include <ctime> // std::time #include <cstdlib> // …

  5. std:: merge - C++ Users

    // merge algorithm example #include <iostream> // std::cout #include <algorithm> // std::merge, std::sort #include <vector> // std::vector int main { int first[] = {5,10,15,20,25}; int second[] = …

  6. find_if - C++ Users

    <algorithm> std:: find_if template <class InputIterator, class UnaryPredicate> InputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred);

  7. Beginners guide to the std::sort() funct - C++ Articles - C++ Users

    May 6, 2013 · The sort() function in the algorithm header can be a very useful tool to both new and experienced programmers. It's use is to sort containers like arrays and vectors. The first …

  8. Find value in range - C++ Users

    // find example #include <iostream> // std::cout #include <algorithm> // std::find #include <vector> // std::vector int main { // using std::find with array and pointer: int myints[] = { 10, 20, 30, 40 }; …

  9. any_of - C++ Users

    // any_of example #include <iostream> // std::cout #include <algorithm> // std::any_of #include <array> // std::array int main { std::array<int,7> foo = {0,1,-1,3,-3,5,-5}; if ( …

  10. std:: transform - C++ Users

    Neither op nor binary_op should directly modify the elements passed as its arguments: These are indirectly modified by the algorithm (using the return value) if the same range is specified for …

Refresh