boost::rts::invoke

Invoke a callable, injecting stored objects as arguments The callable is invoked with zero or more arguments. For each argument type, if an object of that type (or key type) is stored in the container, a reference to that object is passed to the callable.

Synopsis

Declared in <boost/rts/polystore.hpp>

template<class F>
/* implementation-defined */::return_type
invoke(
    polystore& ps,
    F&& f);

Example

struct A { int i = 1; };
polystore ps;
ps.emplace<A>();
ps.invoke([](A& a){ assert(a.i == 1; });

Exceptions

Name

Thrown on

std::bad_typeid

if any reference argument types are not found in the container.

Return Value

The result of the invocation.

Parameters

Name Description

f

The callable to invoke.

ps

A container of type‐erased objects

Created with MrDocs