##5 notable value-types in dotnet

CancellationToken
TimeSpan
DateTime
Guid
System.Nullable — parametrized struct

— /also-rans/ —
System.Drawing.Point
Decimal – just another Float
all “simple types”
all enum types

I feel  these are often immutable. Even if mutable, given the pbclone semantics it’s almost useless to provide mutator methods anyway. However, to understand mutable structs, consider the most improtant value type — int.

In a standard “for (int idx…” idx is mutable, but when you make a copy of idx (or pass in/out a function) the copy is detatched from the mutable int variable.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s