42 #ifndef ACE_COMMON_LINEAR_SEARCH_H
43 #define ACE_COMMON_LINEAR_SEARCH_H
47 namespace ace_common {
66 template<
typename X,
typename K>
68 for (
size_t i = 0; i < size; ++i) {
92 for (
size_t i = 0; i < size; ++i) {
104 [&list](
size_t i) {
return list[i]; } );
size_t linearSearch(const X list[], size_t size, const X &x)
Simplified version of linearSearchByKey() where the elements of the array and the searched element ar...
size_t linearSearchByKey(size_t size, const X &x, K &&key)
Perform a linear search for element 'x' on an abstract list of records.