New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Achieve complete type safe of typed_broker
#317
Achieve complete type safe of typed_broker
#317
Conversation
Can one of the admins verify this patch? |
490c7a1
to
67cb854
Compare
I tried to use |
67cb854
to
f20070b
Compare
It does, my example code was a bit incorrect. It used to be So the preferred syntax should work for you after a rebase. [1] 0dc6005 |
I don't mean that. // check invariants of type system
using dummy1 = typed_actor<reacts_to<int, int>,
replies_to<double>::with<double>>;
//using dummy2 = dummy1::extend<reacts_to<ok_atom>>;
using dummy2 = typed_actor<reacts_to<ok_atom>>;
static_assert(std::is_convertible<dummy2, dummy1>::value,
"handle not assignable to narrower definition"); It has no compilation error on my computer, does it work as expected? |
f20070b
to
cdf4f11
Compare
Crap. The handles are always assignable and only check via |
I'm really sorry for not double-checking this prior to pushing the code to GitHub. I've added a counter-test to the unit test and use SFINAE to make assigning invalid handles impossible: b6a1811 Thank you for your patience (and double-checking the nonsense I wrote). :) |
cdf4f11
to
3b6f726
Compare
Now, it works fine! And the newest commit has been pushed. :) |
@Inet-Jenkins ok to test |
Jenkins didn't work, what's wrong with it? |
Sometimes Jenkins picks up the wrong hash for some reason. @Inet-Jenkins retest this please |
Seems Jenkins hates this PR. |
Looks like it.. |
Improve type safety of `typed_broker`
Relates #309 .
We can just enforcing all message handlers on the typed actors that they are used as server.