Lambda-über-Lambda in C ++ 14

Wie wird der rekursive Lambda-Aufruf beendet / beendet?

#include <cstdio>

auto terminal = [](auto term)            // <---------+  
{                                        //           |
    return [=] (auto func)               //           |  ???
    {                                    //           |
        return terminal(func(term));     // >---------+
    };
};


auto main() -> int
{
    auto hello =[](auto s){ fprintf(s,"Hello\n"); return s; };
    auto world =[](auto s){ fprintf(s,"World\n"); return s; };


    terminal(stdout)
            (hello)
            (world) ;

    return 0;

}

Was vermisse ich hier?

Running code

Antworten auf die Frage(6)

Ihre Antwort auf die Frage