一潘拨、可變參數(shù)模板(Variadic Templates)
void print()
{
}
template <typename T, typename... TYPES>
void print(const T &firstArg, const TYPES &...args)
{
std::cout << firstArg << std::endl;
std::cout << "size: " << sizeof...(args) << std::endl;
print(args...);
}
print(111, "aaa", std::bitset<16>(377));
一设江、匿名函數(shù)(Lambda表達(dá)式)
[capture](parameters)->return-type{body}
// 返回值和參數(shù)可省略
[capture](parameters){body}
[capture]{body}
二、可變模板參數(shù)
template <typename... T>
void f(T... args);
三崖瞭、std::bind
四统屈、std::future胚吁、std::packaged_task
五、std::function
六愁憔、委托構(gòu)造函數(shù)
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者