Is there an equivalent of Python's `pass` in c++ std11?

前端 未结 7 663
轻奢々
轻奢々 2021-01-01 10:26

I want a statement that does nothing but can be used in places requiring a statement. Pass: http://docs.python.org/release/2.5.2/ref/pass.html

Edit: Just saw: How do

7条回答
  •  北海茫月
    2021-01-01 10:32

    I know it's too absurd but you may think using "nop" instruction.

    In Linux

    void pass()
    {
        __asm__("nop");
    }
    

    In Windows

    void pass()
    {
        __asm{nop};
    }
    

提交回复
热议问题