Bagikan melalui


Core.Ref<'T> Record (F#)

The type of mutable references. Use the operators := and ! to get and set values of this type.

Namespace/Module Path: Microsoft.FSharp.Core

Assembly: FSharp.Core (in FSharp.Core.dll)

[<StructuralEquality>]
[<StructuralComparison>]
type Ref<'T> =
 { mutable contents : 'T }
 with
  interface IStructuralEquatable
  interface IComparable
  interface IComparable
  interface IStructuralComparable
  member this.Value :  'T with get, set
 end

Remarks

For an overview of reference cells, see Reference Cells (F#).

This type is named FSharpRef in compiled assemblies. If you are accessing the type from a language other than F#, or through reflection, use this name.

Fields

Field

Description

contents

Type: 'T

The current value of the reference cell.

Instance Members

Member

Description

Value

The current value of the reference cell

Platforms

Windows 7, Windows Vista SP2, Windows XP SP3, Windows XP x64 SP2, Windows Server 2008 R2, Windows Server 2008 SP2, Windows Server 2003 SP2

Version Information

F# Runtime

Supported in: 2.0, 4.0

Silverlight

Supported in: 3

See Also

Reference

Microsoft.FSharp.Core Namespace (F#)