In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
How to use the bind function in C++? for this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
The bind function is in the header file functional
The general form of calling bind:
Auto newCallable = bind (callable, arg_list)
NewCallable is a new callable object, and callable is the original callable object. When newCallable is called, callable is called and the arg_list parameter is passed.
Arg_list parameter
The parameter list contains _ n placeholders and other parameters, _ n is the parameter of the new callable object, and the other is the parameter of the original calling object, and the placeholder is defined in the std::placeholders namespace.
Auto g = bind (f _ a _ r _ b _ c _ r _ 1); / / g is a callable object with two parameters.
G (_ 1 recording 2); / / pass two parameters of g to f call execution
Suppose you call g (x ~ ~ y), then f (a ~ b ~ ~ y ~ c ~ x) will be called.
Bind reference parameter
Using ref or cref to bind, cref creates a const reference.
So much for the answers to the questions on how to use the bind function in C++. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.