Difference between revisions of "Union"

From AtlasWiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
The semantics of Union are those common to C++ unions and Ada discriminated records.
 +
 +
Typically the fields of a union are all physically allocated at the same address.  As a result, the size of the union is the size of the largest of its fields.
  
 
== Specification ==
 
== Specification ==
Line 13: Line 16:
 
|}
 
|}
  
 
+
== Language Mappings ==
 
+
Union maps to the C++ concept of union.  A discriminated union corresponds to an Ada discriminated record.
  
  

Latest revision as of 15:01, 5 March 2014

The semantics of Union are those common to C++ unions and Ada discriminated records.

Typically the fields of a union are all physically allocated at the same address. As a result, the size of the union is the size of the largest of its fields.

Specification

Metaclass Union
Extends Classfier, StructuredType
Description A structure that stores the value of exactly one of a set of fields at any given time

Language Mappings

Union maps to the C++ concept of union. A discriminated union corresponds to an Ada discriminated record.


See Also