Not to be confused with Union (set theory) or Union (SQL).
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Union type" – news · newspapers · books · scholar · JSTOR(August 2009) (Learn how and when to remove this message)
In computer science, a union is a value that may have any of several representations or formats within the same position in memory; that consists of a variable that may hold such a data structure. Some programming languages support special data types, called union types, to describe such values and variables. In other words, a union type definition will specify which of a number of permitted primitive types may be stored in its instances, e.g., "float or long integer". In contrast with a record (or structure), which could be defined to contain both a float and an integer; in a union, there is only one value at any given time.
A union can be pictured as a chunk of memory that is used to store variables of different data types. Once a new value is assigned to a field, the existing data is overwritten with the new data. The memory area storing the value has no intrinsic type (other than just bytes or words of memory), but the value can be treated as one of several abstract data types, having the type of the value that was last written to the memory area.
In type theory, a union has a sum type; this corresponds to disjoint union in mathematics.
Depending on the language and type, a union value may be used in some operations, such as assignment and comparison for equality, without knowing its specific type. Other operations may require that knowledge, either by some external information, or by the use of a tagged union.
languages support special data types, called uniontypes, to describe such values and variables. In other words, a uniontype definition will specify which...
The Auto Union Grand Prix racing cars types A to D were developed and built by a specialist racing department of Auto Union's Horch works in Zwickau, Germany...
subclassing hierarchy, the union of a type and an ancestor type (such as its parent) is the ancestor type. The union of sibling types is a subtype of their...
Value space A type is a set of possible values which a variable can possess. Such definitions make it possible to speak about (disjoint) unions or Cartesian...
TypeScript is a free and open-source high-level programming language developed by Microsoft that adds static typing with optional type annotations to JavaScript...
computer science, a tagged union, also called a variant, variant record, choice type, discriminated union, disjoint union, sum type, or coproduct, is a data...
memory-mapped I/O. An incomplete type is a structure or uniontype whose members have not yet been specified, an array type whose dimension has not yet been...
algebraic types are product types (i.e., tuples and records) and sum types (i.e., tagged or disjoint unions, coproduct types or variant types). The values...
A union territory is a type of administrative division in the Republic of India. Unlike the states of India, which have their own governments, union territories...
75,000 ℛ︁ℳ︁, relocating the company to Auto Union's Horch plant at Zwickau. The Auto Union racing cars types A to D were built as Grand Prix racing cars...
institutions Union University (disambiguation), the name of several institutions Economic union, a type of trade bloc Political union, a type of state which...
uniontype is a special construct that permits access to the same memory block by using a choice of differing type descriptions. For example, a union...
In mathematics, the disjoint union (or discriminated union) A ⊔ B {\displaystyle A\sqcup B} of the sets A and B is the set formed from the elements of...
NilClass type. JavaScript has a null and undefined values. Null coalescing operator Semipredicate problem Uniontype Unit type "Nullable Types (C#)". Msdn...
Civil union, type of legal partnership Cubit, ancient unit of length CU (store), a chain of South Korean convenience stores Customs union, a type of intergovernmental...
computer science, type conversion, type casting, type coercion, and type juggling are different ways of changing an expression from one data type to another...
conventional Miller four-cylinder engine. The mid-engined Auto UnionType A, Type B and Type C Grand Prix cars of 1933 to 1938 were powered by supercharged...
of the Soviet Union (Russian: Герой Советского Союза, romanized: Geroy Sovietskogo Soyuza) was the highest distinction in the Soviet Union, awarded together...
within a struct or uniontype, an expression of type size_t. The offsetof() macro takes two parameters, the first being a structure or union name, and the...
Movable type (US English; moveable type in British English) is the system and technology of printing and typography that uses movable components to reproduce...
Iberian Union is a historiographical term used to describe the dynastic union of the Monarchy of Spain, which in turn was itself a dynastic union of the...
the Type 300. On 1 December 1934, the Air Ministry issued contract AM 361140/34, providing £10,000 for the construction of Mitchell's improved Type 300...
A union suit is a type of one-piece long underwear, most often associated with menswear in the late 19th and early 20th centuries. Created in Utica, New...
Sovyet Natsionalnostey) was the upper chamber of the Supreme Soviet of the Union of Soviet Socialist Republics, elected on the basis of universal, equal...
array element type. As such, it is often used to simplify the syntax of declaring complex data structures consisting of struct and uniontypes, although it...
type conversion and union — C++ adds reference type conversion and reinterpret_cast to this list — are provided in order to permit many kinds of type...