How would you implement a basic event-loop?
问题 If you have worked with gui toolkits, you know that there is a event-loop/main-loop that should be executed after everything is done, and that will keep the application alive and responsive to different events. For example, for Qt, you would do this in main(): int main() { QApplication app(argc, argv); // init code return app.exec(); } Which in this case, app.exec() is the application's main-loop. The obvious way to implement this kind of loop would be: void exec() { while (1) { process