Value Type - Types of Objects With Deep Copy Semantics

Types of Objects With Deep Copy Semantics

Some programming languages—notably C# and D—use the term value type to refer to the types of objects for which assignment has deep copy semantics (as opposed to reference types, which have shallow copy semantics). For example:

int i1 = 42; // "int" is a value type. int i2 = i1; // i2 uses distinct storage for its value: // the value of i1 is "deep-copied" into i2. object o1 = i1; // "Boxing" (see below) from the value type "int" // to a reference type compatible with "object". object o2 = o1; // Since o1 and o2 have reference type, they // now refer to the same value storage; i.e., // o1 is "shallow-copied" into o2.

Other programming languages—e.g., Java—do not formally define the term value type, but their practitioners informally use the term to refer to types with deep copy semantics (such as Java's primitive types).

Read more about this topic:  Value Type

Famous quotes containing the words types of, types, objects, deep and/or copy:

    ... there are two types of happiness and I have chosen that of the murderers. For I am happy. There was a time when I thought I had reached the limit of distress. Beyond that limit, there is a sterile and magnificent happiness.
    Albert Camus (1913–1960)

    He’s one of those know-it-all types that, if you flatter the wig off him, he chatter like a goony bird at mating time.
    —Michael Blankfort. Lewis Milestone. Johnson (Reginald Gardner)

    Change begets change. Nothing propagates so fast. If a man habituated to a narrow circle of cares and pleasures, out of which he seldom travels, step beyond it, though for never so brief a space, his departure from the monotonous scene on which he has been an actor of importance would seem to be the signal for instant confusion.... The mine which Time has slowly dug beneath familiar objects is sprung in an instant; and what was rock before, becomes but sand and dust.
    Charles Dickens (1812–1870)

    He began therefore to invest the fortress of my heart by a circumvallation of distant bows and respectful looks; he then entrenched his forces in the deep caution of never uttering an unguarded word or syllable. His designs being yet covered, he played off from several quarters a large battery of compliments. But here he found a repulse from the enemy by an absolute rejection of such fulsome praise, and this forced him back again close into his former trenches.
    Sarah Fielding (1710–1768)

    I learn immediately from any speaker how much he has already lived, through the poverty or the splendor of his speech. Life lies behind us as the quarry from whence we get tiles and copestones for the masonry of today. This is the way to learn grammar. Colleges and books only copy the language which the field and the work-yard made.
    Ralph Waldo Emerson (1803–1882)