#地区的相当于C ++ [英] Equivalent of #region for C++

查看:110
本文介绍了#地区的相当于C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是#区域为C的C ++相当于++这样我可以把自定义代码可折叠位,使我的代码更易于阅读?

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?

推荐答案

关键字是特定IDE并影响呈现在Visual Studio中。最近的等效是的#pragma地区这是适用于Visual只有工作室。从的

The Region keyword is IDE specific and affects rendering in Visual Studio. The nearest equivalent is #pragma Region which is applicable to Visual Studio only .

代码示例http://msdn.microsoft.com/en-us/library/b6xkz944%28v=vs.80%29.aspx > MSDN

Code example from MSDN

// pragma_directives_region.cpp
#pragma region Region_1
void Test() {}
void Test2() {}
void Test3() {}
#pragma endregion Region_1

int main() {}

这篇关于#地区的相当于C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆