Skip to content

Instantly share code, notes, and snippets.

@JohnMurray
Last active July 26, 2020 23:14
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/07cc6e9d744e1255411cdfdd9136f59a to your computer and use it in GitHub Desktop.
Save JohnMurray/07cc6e9d744e1255411cdfdd9136f59a to your computer and use it in GitHub Desktop.
class SerializabelHello {};
class NonSerializableHello {};
class HelloBehavior: public Behavior {
virtual void receive(SerializableHello const& msg) = 0;
virtual void receive(NonSerializableHello const& msg) = 0;
};
class HelloActor: public Actor, public HelloBehavior { ... };
void main() {
auto system = ActorSystem{};
auto ref = make_actor<HelloActor>(system, "Greetings");
ref.send(SerializableHello{}); // compiles!
ref.send(NonSerializableHello{}); // doesn't compile!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment