Replies: 3 comments
-
|
We can just add the placeholder : wakeupChannel_->setReadCallback(std::bind(&EventLoop::handleRead, this, std::placeholders::_1)); And add the parameter although we don't need it : void EventLoop::handleRead(Timestamp receiveTime); |
Beta Was this translation helpful? Give feedback.
-
|
It's not an error, but a feature of std::bind(). Ref. docs:
|
Beta Was this translation helpful? Give feedback.
-
|
Close as WAI (working as intended), dup of #456. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In https://github.com/chenshuo/muduo/blob/cpp11/muduo/net/EventLoop.cc
line 87 : wakeupChannel_->setReadCallback(std::bind(&EventLoop::handleRead, this));
line 244 : void EventLoop::handleRead() ...
But In https://github.com/chenshuo/muduo/blob/cpp11/muduo/net/Channel.h
line 37 : typedef std::function<void(Timestamp)> ReadEventCallback;
The ReadEventCallback has one parameter. If we call this callback, then a small error occurs.
Beta Was this translation helpful? Give feedback.
All reactions