Documentation Home >> Headers >> <jss/actor.hpp> Header >> jss::actor >> jss::actor constructor for starting an actor

Construct a new jss::actor instance running the specified function.

template<typename Func,typename ... Args>
explicit actor(Func&& f,Args&& ... args);

Effects:

Constructs a jss::actor instance running a copy of the specified function on a new thread, with copies of the specified args. The copies are contructed as-if Func temp(std::forward<Func>(f)) and ArgsN tempN(std::forward<ArgsN>(argsN)) for each element in Args....

Throws:

std::system_error if the actor thread cannot be started; any exceptions thrown by the copy or move constructor of Func.

Postconditions:

this->valid() returns true.

Header

#include <jss/actor.hpp>

See Also