Core.byref<'T> Type (F#)

Represents a managed pointer in F# code.

Namespace/Module Path: Microsoft.FSharp.Core

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

type byref<'T> =
 class
 end

Remarks

The byref type is used to pass an argument to a function or method with reference semantics. A ref or out parameter in C# is seen from F# as a parameter of this type. A reference cell may be used as an argument for parameters of this type. The following code illustrates this.

    let date = ref System.DateTime.Now
    if System.DateTime.TryParse("1/1/2001", date ) then
       printfn "%A" !date
    else
       printfn "Failed to parse input."

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#)