support for #region in C++/CLI

L

Lonewolf

Hi
in C#, it is possible to define a region which can be tucked away in
the IDE by defining a #region and #endregion pair in the code. I realize
this does not seem to work for C++/CLI, be it native or managed code. Is
there soemthing equivalent in C++/CLI or it's totally not supported yet?
 
J

James Park

Lonewolf said:
Hi
in C#, it is possible to define a region which can be tucked away in the
IDE by defining a #region and #endregion pair in the code. I realize this
does not seem to work for C++/CLI, be it native or managed code. Is there
soemthing equivalent in C++/CLI or it's totally not supported yet?

Straight from msdn2:
#pragma region name
#pragma endregion comment
 
L

Lonewolf

James said:
Straight from msdn2:
#pragma region name
#pragma endregion comment

thanx for the enlightenment. Funny, why don't they just keep it to
#region since it is a IDE thing, not a program syntax thing.
 
C

Carl Daniel [VC++ MVP]

Lonewolf said:
thanx for the enlightenment. Funny, why don't they just keep it to
#region since it is a IDE thing, not a program syntax thing.

But the compiler (preprocessor, really) needs to know to ignore it. It
already is prepared to handle #pragma, so it makes sense to use that
mechanism for regions as well.

-cd
 
A

Arnaud Debaene

Lonewolf said:
thanx for the enlightenment. Funny, why don't they just keep it to
#region since it is a IDE thing, not a program syntax thing.

By using a pragma, you're guaranteed to stay compatible with other compilers
who don't know anything about the "region" functionnality.

Arnaud
MVP - VC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top