Last active
July 26, 2020 23:14
-
-
Save JohnMurray/07cc6e9d744e1255411cdfdd9136f59a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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