This is the old code:
Code: Select all
channel->LogEvent.connect (this, &Export::channelEvent);
Code: Select all
connect (channel, &Channel::LogEvent, this, &Export::channelEvent);
Code: Select all
C2338: static_assert failed: 'connect(): Signal was not a child class of Sender'
C2338: static_assert failed: 'connect(): Slot was not a child class of Receiver'
C2530: 'item': references must be initialized
C3531: 'item': a symbol whose type contains 'auto' must have an initializer
C2143: syntax error: missing ';' before ':'
C3536: 'senderListHandle': cannot be used before it is initialized
C2100: illegal indirection
C2143: syntax error: missing ';' before ')'
Code: Select all
connect (*channel, &Channel::LogEvent, *this, &Export::channelEvent);
Before I continue with the conversion I would like know a bit more about the reasoning behind this design.
[1] I know *this will work,I just have never been forced to use it this way.