template <typename... Args>
auto unwrap(Args&&... args)
    -> decltype(util::detail::unwrap_depth_impl<
                1U>(
        static_cast<decltype(args)&&>(args)...))

Description

A helper function for retrieving the actual result of any pika::future like type which is wrapped in an arbitrary way. Unwraps the given pack of arguments, so that any pika::future object is replaced by its future result type in the argument pack: - `pika::future <int >` -> `int` - `pika::future <std ::vector <float >>` -> `std::vector <float >` - `std::vector <future <float >>` -> `std::vector <float >` The function is capable of unwrapping pika::future like objects that are wrapped inside any container or tuple like type, see pika::util::map_pack() for a detailed description about which surrounding types are supported. Non pika::future like types are permitted as arguments and passed through. ```cpp // Single arguments int i1 = pika:unwrap(pika::make_ready_future(0)); // Multiple arguments pika::tuple <int , int> i2 = pika:unwrap(pika::make_ready_future(1), pika::make_ready_future(2)); ```

Declared at: libs/pika/pack_traversal/include/pika/pack_traversal/unwrap.hpp:64

Parameters

Args&&... args
the arguments that are unwrapped which may contain any arbitrary future or non future type.

Returns

Depending on the count of arguments this function returns a pika::tuple containing the unwrapped arguments if multiple arguments are given. In case the function is called with a single argument, the argument is unwrapped and returned.