Function poly_call

Synopsis

#include <src/entt/poly/poly.hpp>

template <std::size_t Member, typename Poly, typename... Args>
decltype(auto) poly_call(Poly &&self, Args &&...args)

Description

Shortcut for calling poly_base<Type>invoke.

Template Parameters

Member - Index of the function to invoke.

Poly - A fully defined poly object.

Args - Types of arguments to pass to the function.

Parameters

self - A reference to the poly object that made the call.

args - The arguments to pass to the function.

Returns
The return value of the invoked function, if any.

Mentioned in

Source

Lines 172-175 in src/entt/poly/poly.hpp.

template<std::size_t Member, typename Poly, typename... Args>
decltype(auto) poly_call(Poly &&self, Args &&...args) {
    return std::forward<Poly>(self).template invoke<Member>(self, std::forward<Args>(args)...);
}





Add Discussion

Log in to comment