Skip to content

Instantly share code, notes, and snippets.

@JohnMurray
Last active August 2, 2020 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnMurray/3e51cd19704c72ec126d5f278004caed to your computer and use it in GitHub Desktop.
Save JohnMurray/3e51cd19704c72ec126d5f278004caed to your computer and use it in GitHub Desktop.
int main() {
std::unique_ptr<Actor> actor = std::make_unique<HelloActor>("Howdy");
actor->enqueue([&actor]() {
// how do I get it to the correct receiver?
dynamic_cast<HelloBehavior*>(actor.get())->receive("neighbor");
});
actor->process_message();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment