從n3290 ISO草案A點: Lambda表達式:第5.1.2節,第6段:Lambda表達式:n3290草案
"The closure type for a lambda-expression with no
lambda-capture has a public non-virtual non-explicit const
conversion function to pointer to function having the same
parameter and return types as the closure type’s function
call operator. The value returned by this conversion
function shall be the address of a function that, when
invoked, has the same effect as invoking the closure
type’s function call operator."
任何一個可以用一個例子說明了這一點嗎?
有沒有這個特定的部分,你覺得混亂?有沒有你不明白的術語?你不明白要求的行爲是什麼? –
@ James:typedef int(* pf)(int);我們可以使用int callback(pf func){returnfunc(3);} pf func = [](int k) - > int {k--;返回k;}; – user751747
@ James:就是上面的..example ..表示上面的語句... iam對於這個點有點困惑,「與調用閉包類型的函數調用操作符相同的效果」..但我可以用程序來證明.. – user751747