Groups
Groups
Sign in
Groups
Groups
Muduo network library
Conversations
About
Send feedback
Help
请问一下TimerQueue 构造函数里bind的问题
32 views
Skip to first unread message
clay Leven
unread,
Jan 27, 2021, 2:25:40 AM
1/27/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Muduo network library
请问一下TimerQueue构造函数里的timerfdChannel_.setReadCallback(td::bind(&TimerQueue::handleRead, this));setReadCallback参数不是一个std::function<void(Timestamp)>嘛,为啥可以bind一个void void的函数啊
Shuo Chen
unread,
Jan 27, 2021, 1:42:11 PM
1/27/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Muduo network library
Ref. docs:
1.
https://www.boost.org/doc/libs/1_66_0/libs/bind/doc/html/bind.html#bind.purpose.using_bind_with_functions_and_fu
>
Any extra arguments are silently ignored
, just like the first and the second argument are ignored in the third example.
2.
https://en.cppreference.com/w/cpp/utility/functional/bind
> If some of the arguments that are supplied in the call to g() are not matched by any placeholders stored in g, the
unused arguments are evaluated and discarded
.
Reply all
Reply to author
Forward
0 new messages