Home | History | Annotate | Download | only in gdbsupport

Lines Matching defs:function_view

21 /* function_view is a polymorphic type-erasing wrapper class that
24 A way to put it is that function_view is to std::function like
26 type-erased callable object internally, function_view holds a
78 quite pervasive, a function_view is a better choice, because while
79 function_view is light and does not require any heap allocation,
95 Note that because function_view is a non-owning view of a callable,
97 function_view that calls it. This is not really a problem for the
98 use case function_view is intended for, such as passing a temporary
103 Calling a function_view with no associated target is undefined,
106 function_view::operator().
108 Since function_view objects are small (a pair of pointers), they
116 iterate_over_foos (gdb::function_view<void (foo *)> callback)
152 automatically create a function_view from a callable without having
153 to specify the function_view's template parameter. E.g.:
159 whose function_view parameter type depends on the function's
161 callable->function_view conversion for the function_view argument.
162 You must pass a function_view argument already of the right type to
166 void my_function (T v, gdb::function_view<void(T)> callback = nullptr);
175 gdb::function_view<void(int)> fv = [&] (int) { ... }; // dangles
182 gdb::function_view<void(int)> fv = lambda;
186 function_view's full type, and, avoids worrying about dangling. For
199 /* Bits shared by all function_view instantiations that do not depend
219 struct function_view;
222 class function_view<Res (Args...)>
237 /* True if Callable is a function_view. Used to avoid hijacking the
241 : std::is_same<function_view, typename std::decay<Callable>::type>
247 constexpr function_view () noexcept
253 function_view (const function_view &) = default;
254 function_view &operator= (const function_view &) = default;
263 function_view (Callable &&callable) noexcept
268 /* Construct a NULL function_view. */
269 constexpr function_view (std::nullptr_t) noexcept
274 /* Clear a function_view. */
275 function_view &operator= (std::nullptr_t) noexcept
293 /* Bind this function_view to a compatible function object
309 /* Bind this function_view to a compatible function pointer.
345 operator== (const function_view<Res (Args...)> &f, std::nullptr_t) noexcept
350 operator== (std::nullptr_t, const function_view<Res (Args...)> &f) noexcept
355 operator!= (const function_view<Res (Args...)> &f, std::nullptr_t) noexcept
360 operator!= (std::nullptr_t, const function_view<Res (Args...)> &f) noexcept
365 /* Helper traits type to automatically find the right function_view
379 using type = gdb::function_view<Res (Args...)>;
410 /* Const member functions. function_view doesn't support these, but
439 /* Make a function_view from a callable. Useful to automatically
440 deduce the function_view's template argument type. */