locked
lambda RRS feed

  • Question

  • Hi everyone

    The following program runs successfully in gcc. What does '+' which precedes the lambda function means? How is it used?

    Regards

    Chong

    #include <iostream>
    #include <functional>
    
    template <typename... T>
    void func_a(void(*func)(T...)) {
    	func(1);
    }
    
    int main() {
    	func_a(+[](int x) -> void { printf("potato\n"); });
    	return 0;
    }



    Wednesday, September 14, 2016 11:47 PM

All replies