/***************************************************************************** * Copyright (c) 2014-2024 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ #pragma once #include #include template> ForwardIt BinaryFind(ForwardIt first, ForwardIt last, const T& value, Compare comp = {}) { first = std::lower_bound(first, last, value, comp); return first != last && !comp(value, *first) ? first : last; }