### cpp_extensions

Controls language extensions to ISO C++.

##### Syntax

#pragma cpp_extensions on | off | reset

##### Targets

All platforms.

##### Remarks

If you enable this pragma, you can use the following extensions to the ANSI C++ standard that would otherwise be illegal:

- Anonymous struct & union objects

> #pragma cpp_extensions on
> void foo()
> {
> union {
> long hilo;
> struct { short hi, lo; }; // anonymous struct
> };
> hi=0x1234;
> lo=0x5678; // hilo==0x12345678
> }

- Unqualified pointer to a member function

> #pragma cpp_extensions on
> struct Foo { void f(); }
> void Foo::f()
> {
> void (Foo::*ptmf1)() = &Foo::f; // ALWAYS OK

> void (Foo::*ptmf2)() = f; // OK if you enable cpp_extensions.
> }

- Inclusion of const data in precompiled headers.

This pragma does not correspond to any setting . To check this setting, use the __option (cpp_extensions). This pragma is on if generating Win32/x86-compatible object code; off if not.