aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/safe-iterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/safe-iterator.h')
-rw-r--r--gdbsupport/safe-iterator.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdbsupport/safe-iterator.h b/gdbsupport/safe-iterator.h
index bc8b435..ccd772c 100644
--- a/gdbsupport/safe-iterator.h
+++ b/gdbsupport/safe-iterator.h
@@ -19,6 +19,8 @@
#ifndef COMMON_SAFE_ITERATOR_H
#define COMMON_SAFE_ITERATOR_H
+#include "gdbsupport/invoke-result.h"
+
/* A forward iterator that wraps Iterator, such that when iterating
with iterator IT, it is possible to delete *IT without invalidating
IT. Suitably wrapped in a range type and used with range-for, this
@@ -75,7 +77,9 @@ public:
basic_safe_iterator ()
{}
- value_type operator* () const { return *m_it; }
+ typename gdb::invoke_result<decltype(&Iterator::operator*), Iterator>::type
+ operator* () const
+ { return *m_it; }
self_type &operator++ ()
{