Closed ilpropheta closed 3 years ago
Hi!
I don't think that it's a compiler bug. It seems to be a missed case inside template magic around send
functions. Redirection of signals usually doesn't have a sense, and I think that there is no such test case in our codebase yet.
I'll check it more carefully.
@ilpropheta the fix is in the master branch.
Hi @eao197, you are right, it's not the compiler. I had a too quick look at the issue!
I totally agree with you that it's not useful to redirect signals, however I would like to give you some context. Basically, as mentioned in #30, I have designed a sort of Parrot agent that is able to redirect any messages of a set of types to a mchain_t
. Imagine something like that:
auto chain = context.AddParrot<int, std::string, MyMessage>(mbox);
This above registers a special agent that redirects any int
, std::string
, and MyMessage
from the given mbox
to chain
. In my scenario, this simple agent is useful for many things (unit testing, load-balancing schemes, etc).
Today I have tried redirecting a signal but I got the mentioned error because my generic implementation was simply implemented in terms of two-argument so_5::send
. E.g.:
so_5::send(dst, message);
Fixing the issue on my side was very simple (I just added a specialization for signals) but I think it was worth mentioning to you :)
Many thanks for your quick fix!
Writing template agents that are parametrized by types of messages/signals received is, maybe, the only sensible case for redirection of signals. That code works in older versions of SObjectizer but was broken during the development of SO-5.6. And we didn't encounter that bug because that redirection wasn't used in our projects nor SObjectizer's tests.
Thanks for reporting!
Hi everyone, just to report that redirecting a signal gives a compilation error on Visual Studio 2019 with C++17 enabled (tested on version
16.10.1
):This causes the compiler to complain on line
297
ofsend_functions.hpp
:I'm using the latest version of SObjectizer (5.7.2.5).
I have not investigated the issue but it seems a bug of the compiler. Is that something happening also on others?