Why does the program display 0? The function description says Returns true if the sorted range [first1, last1) contains all the elements in the sorted range [first2, last2). http://www.cplusplus.com/reference/algorithm/includes/ . But a contains all elements from b (1 and 2)
std::vector a{1, 2}; std::vector b{1, 2, 1, 2}; std::cout << std::includes(a.begin(), a.end(), b.begin(), b.end());
sorted rangerequirement is clearly not met. - VTT