-
Key: IDL4CPP-44
-
Status: closed
-
Source: Remedy IT ( Johnny Willemsen)
-
Summary:
As far as I understand it enum_prefix/enum_postfix are a way to change the enum mapping but I don't understand why, because the enums itself are added to the enclosing module, so the following IDL is already illegal, red can't be defined twice
scope. For example the following IDL is illegalenum Colors { red, green, blue }; enum Colors2 { red, green, blue };
See IDL4.2, chapter 7.5.2, search for "Enumeration value names are introduced into the enclosing scope and then are treated like any other declaration in that
-
Reported: IDL4-CPP 1.0b1 — Thu, 25 Jan 2024 12:48 GMT
-
Disposition: Closed; No Change — IDL4-CPP 1.0b2
-
Disposition Summary:
Enum prefixes and postfixes prevent conflicts with external C++ code
In C++ 98, the mapping of IDL enums does not prevent conflicts of IDL-defined literals with the C++ code a user might be mixing or linking against. That's why even though the IDL grammar does not allow conflicts in literals within the same IDL code (such conflicts are illegal in IDL), an end user might have conflicts in the generated code, which can only be prevented adding prefix or postfix enum literal names. Mapping enums to enum classes does address this issue, but such functionality is unavailable in C++ 98.
-
Updated: Mon, 16 Sep 2024 14:15 GMT
IDL4CPP — enum_prefix/enum_postfix required
- Key: IDL4CPP-44
- OMG Task Force: IDL4 to C++ Language Mapping (IDL4-CPP) 1.0 FTF