What is _In_ in C++?

Infinity James picture Infinity James · Jul 12, 2012 · Viewed 21.8k times · Source

I have searched this up rather a lot, but come up with no helpful results.

I am currently trying to program simple DirextX game for Windows 8 Metro, and have come across _In_ rather a lot. I'm just wondering what it is.

Also, I have seen a lot of the use of ^ as the pointer * which I found odd. On top of this, some classes have an interface of ref class MyClass, which I believe is for C# legibility.

Anyway, any help would be brilliant.

Answer

James McNellis picture James McNellis · Jul 12, 2012

It is a SAL annotation, used for code analysis. The annotations themselves are defined as macros that, in normal builds, expand to nothing.

The ^ and ref class are features of C++/CX, a set of language extensions developed to make it easier to build Metro style apps for Windows 8 in C++. Neither is a part of standard C++. The documentation (linked previously) has links to tutorials and references describing the language extensions.