Skip to content
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

Discrepancy between send and delayed_send for groups #634

Closed
rkfg opened this issue Dec 16, 2017 · 0 comments
Closed

Discrepancy between send and delayed_send for groups #634

rkfg opened this issue Dec 16, 2017 · 0 comments
Labels

Comments

@rkfg
Copy link
Contributor

rkfg commented Dec 16, 2017

Given the example from #632, consider the following code:

    scoped_actor self(system);
    self->delayed_send(grp, 1s, "test");
    self->send(grp, "test");

The delayed_send line doesn't compile:

In file included from /opt/build/static/include/caf/send.hpp:25:0,
                 from /opt/build/static/include/caf/all.hpp:27,
                 from ../src/main.cpp:1:
/opt/build/static/include/caf/actor_cast.hpp: In instantiation of ‘constexpr const bool caf::{anonymous}::is_weak_ptr<caf::group>::value’:
/opt/build/static/include/caf/actor_cast.hpp:173:18:   required from ‘T caf::actor_cast(U&&) [with T = caf::intrusive_ptr<caf::actor_control_block>; U = const caf::group&]’
/opt/build/static/include/caf/mixin/sender.hpp:142:60:   required from ‘void caf::mixin::sender<Base, Subtype>::delayed_send(const Dest&, const caf::duration&, Ts&& ...) [with caf::message_priority P = (caf::message_priority)0; Dest = caf::group; Ts = {const char (&)[5]}; Base = caf::scheduled_actor; Subtype = caf::event_based_actor]’
src/subdir.mk:18: recipe for target 'src/main.o' failed
/opt/build/static/include/caf/mixin/sender.hpp:151:17:   required from ‘void caf::mixin::sender<Base, Subtype>::delayed_send(const Dest&, std::chrono::duration<Rep, Period>, Ts&& ...) [with caf::message_priority P = (caf::message_priority)0; Rep = long int; Period = std::ratio<1>; Dest = caf::group; Ts = {const char (&)[5]}; Base = caf::scheduled_actor; Subtype = caf::event_based_actor]’
../src/main.cpp:21:43:   required from here
/opt/build/static/include/caf/actor_cast.hpp:64:25: error: ‘has_weak_ptr_semantics’ is not a member of ‘caf::group’
   static constexpr bool value = T::has_weak_ptr_semantics;
                         ^~~~~
make: *** [src/main.o] Error 1

While the next line compiles fine and works as expected. I don't see much semantic difference between the two so I suppose the both cases should be possible and it's a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants