Top "Stl-algorithm" questions

A collection of algorithms defined as template functions in the <algorithm> header of C++'s standard library.

map, lambda, remove_if

So, i've problem with std::map, lambda and stl algorithm(remove_if). Actually, same code with std::list or std::…

c++ lambda c++11 stdmap stl-algorithm
sum of square of each elements in the vector using for_each

As the function accepted by for_each take only one parameter (the element of the vector), I have to define …

c++ vector stl-algorithm
Why are std::shuffle methods being deprecated in C++14?

According to the cppreference.com reference site on std::shufle, the following method is being deprecated in c++14: template< …

c++ c++11 deprecated c++14 stl-algorithm
LCS ALGORITHM ( example )

There's a dynamic programming algorithm to find the Longest Common Subsequence of two sequences. How can I find the LCS …

algorithm stl-algorithm algorithmic-trading lcs
Is it possible to use std::sort with a sort function that takes extra arguments?

This is something that I've been considering for a while. I've done some research and can't find anything on it, …

c++ algorithm sorting c++11 stl-algorithm
std::ostream_iterator prevent last item from using the delimiter

Is there a way to use a std::ostream_iterator (or similar) such that the delimiter isn't placed for the …

c++ iostream stl-algorithm
Is inserting in the end equivalent to std::copy()?

Consider following two ways to append elements into a vector std::vector<int> vi1(10,42), vi2; vi2.insert(vi2.…

c++ stl-algorithm
Is there a safe alternative to std::equal?

std::equal() is unsafe because the function cannot know whether it will overrun the length of the second container to …

c++ stl containers stl-algorithm