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

前端 未结 7 695
轻奢々
轻奢々 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

    As @bboonn suggests:

     if (some_flag)
       ; // Do nothing
    
     else if (some_other_flag)
       do_something();
    

提交回复
热议问题