Tuple invocation

Utilities for tuples of callables.

Reference

template<Tuple T, class ...Args>
void ac::invoke_all_matching(T &&tuple_to_invoke, Args&&... args)

Invokes in order all the tuple elements that are invocable with args.

Note

args aren’t forwarded to the invocations but passed by reference, because they may be shared between multiple invocations.

template<Tuple T, class ...Args>
decltype(auto) ac::invoke_first_matching(T &&tuple_to_invoke, Args&&... args)

Invokes the first tuple element that is invocable with args (it’s required to exist) and returns its result.

Source code

Tests