Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: C++ User's Guide Oracle Solaris Studio 12.3 Information Library |
3. Using the C++ Compiler Options
4.1.1 Compatibility with Microsoft Windows
4.3 Overriding With Less Restrictive Virtual Functions
4.4 Making Forward Declarations of enum Types and Variables
4.5 Using Incomplete enum Types
4.7 Using Anonymous struct Declarations
4.8 Passing the Address of an Anonymous Class Instance
4.9 Declaring a Static Namespace-Scope Function as a Class Friend
4.10 Using the Predefined __func__ Symbol for Function Name
4.11.1 __packed__ Attribute Details
4.12 Compiler Support for Intel MMX and Extended x86 Platform Intrinsics
6. Creating and Using Templates
9. Improving Program Performance
10. Building Multithreaded Programs
12. Using the C++ Standard Library
Because an enum declaration does not introduce a scope, an enum name cannot be used as a scope qualifier. For example, the following code is invalid.
enum E {e1, e2, e3}; int i = E::e1; // invalid: E is not a scope name
To compile this invalid code, use the -features=extensions option. The -features=extensions option instructs the compiler to ignore a scope qualifier if it is the name of an enum type.
To make the code valid, remove the invalid qualifier E::.
Note - Use of this option increases the possibility of typographical errors yielding incorrect programs that compile without error messages.