Home > Back-end >  17 C syntax &&... And -> is what???
17 C syntax &&... And -> is what???

Time:10-11

 
The class ThreadPool {
Public:
ThreadPool (size_t);
Template
Auto the enqueue (F& & F, Args& & . The args)
-> STD: : future;
~ ThreadPool ();
Private:
//the need to keep track of the threads so we can join them
STD: : vector//the task queue
STD: : queue The tasks;

//synchronization
STD: : mutex queue_mutex;
STD: : condition_variable condition;
Bool stop;
};

CodePudding user response:

& & This is the right value reference.
. The representative is longer template parameters,
-> The function return value deduction,
=======================
A sentence or two, say not clear, it is suggested that to see a book on c + + 11

CodePudding user response:

Rvalue references and Lambda expressions

CodePudding user response:

Rvalue references and Lambda expressions

CodePudding user response:

[& amp; total] (int x)
{
Total +=x;
});
This way is lambda expressions

CodePudding user response:

reference 1/f, the truth is more important than right or wrong response:
& amp; & This is the right value reference.
. The representative is longer template parameters,
-> The function return value deduction,
=======================
A sentence or two, say not clear, it is suggested that to see a book on c + + 11


Auto the enqueue (F& & F, Args& & . The args)
-> STD: : future;//this function returns a value derived typename is what role?
  • Related