Equivalent of #region for C++

前端 未结 10 1214
無奈伤痛
無奈伤痛 2020-12-24 04:17

What\'s the C++ equivalent of #region for C++ so I can put in custom code collapsible bits and make my code a little easier to read?

10条回答
  •  别那么骄傲
    2020-12-24 04:51

    I've been using

    #ifndef ANY_NAME_FOR_THIS_REGION
        ...
    #endif
    

    for several projects during the last couple of years and that suits me (including collapsible blocks). as an addition, i can disable the block using #define ANY_NAME_FOR_THIS_REGION just above it.

提交回复
热议问题