What is the proper way of doing event handling in C++?

前端 未结 4 606
借酒劲吻你
借酒劲吻你 2020-11-30 06:40

I have an application that needs to respond to certain events in the following manner:

void someMethodWithinSomeClass() {
    while (true) {
        wait for         


        
4条回答
  •  野性不改
    2020-11-30 07:20

    The C++ Standard doesn't address events at all. Usually, however, if you need events you are working within a framework that provides them (SDL, Windows, Qt, GNOME, etc.) and ways to wait for, dispatch and use them.

    Aside from that, you may want to look at Boost.Signals2.

提交回复
热议问题