Equivalent of #region for C++

前端 未结 10 1240
無奈伤痛
無奈伤痛 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 05:12

    There isn't an equivalent in C++. However IDEs should be able to collapse sections.

    It is also possible to use something like this:

    #pragma region
    
    #pragma endregion A comment about the region.
    

    But probably not very portable

提交回复
热议问题