g++ does not show a 'unused' warning

后端 未结 3 1803
一个人的身影
一个人的身影 2020-11-29 11:13

I have a little piece of code in C++:

#include 
#include 
#include 

using namespace std;

int main() {

    in         


        
3条回答
  •  佛祖请我去吃肉
    2020-11-29 11:34

    Because you could have done that with a purpose. It's not a primitive. Maybe the constructor and destructor do something important?

    MFC even had classes that operated that way, you could do this:

    void foo()
    {
        CWaitCursor cursor;
    
        [...]
    }
    

    That would display an hourglass icon for the duration of the function.

提交回复
热议问题