RosettaCodeData/Task/Binary-search/C++/binary-search-7.cpp

2 lines
107 B
C++

bool found = std::binary_search(array, array+len, what); // a custom comparator can be given as fourth arg