aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/gdb_binary_search.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/gdb_binary_search.h')
-rw-r--r--gdbsupport/gdb_binary_search.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdbsupport/gdb_binary_search.h b/gdbsupport/gdb_binary_search.h
index b6771b9..4010a8c 100644
--- a/gdbsupport/gdb_binary_search.h
+++ b/gdbsupport/gdb_binary_search.h
@@ -17,13 +17,13 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
#ifndef GDBSUPPORT_GDB_BINARY_SEARCH_H
#define GDBSUPPORT_GDB_BINARY_SEARCH_H
#include <algorithm>
-namespace gdb {
+namespace gdb
+{
/* Implements a binary search using C++ iterators.
This differs from std::binary_search in that it returns an iterator for
@@ -39,17 +39,17 @@ namespace gdb {
The return value is an iterator pointing to the found element, or LAST if
no element was found. */
template<typename It, typename T, typename Comp>
-It binary_search (It first, It last, T el, Comp comp)
+It
+binary_search (It first, It last, T el, Comp comp)
{
auto lt = [&] (const typename std::iterator_traits<It>::value_type &a,
- const T &b)
- { return comp (a, b) < 0; };
+ const T &b) { return comp (a, b) < 0; };
auto lb = std::lower_bound (first, last, el, lt);
if (lb != last)
{
if (comp (*lb, el) == 0)
- return lb;
+ return lb;
}
return last;
}