Value

open class Value : ValueBase, ExpressibleByStringLiteral, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, ExpressibleByBooleanLiteral

Undocumented

  • Declaration

    Swift

    public typealias StringLiteralType = StaticString
  • Declaration

    Swift

    public typealias ExtendedGraphemeClusterLiteralType = StaticString
  • Declaration

    Swift

    public typealias UnicodeScalarLiteralType = StaticString
  • Declaration

    Swift

    public typealias IntegerLiteralType = Int
  • Declaration

    Swift

    public typealias FloatLiteralType = Double
  • Declaration

    Swift

    public typealias BooleanLiteralType = Bool
  • Designated initialiser, allocating a value in memory

    Declaration

    Swift

    required public init()
  • Convenience value constructor

    Declaration

    Swift

    convenience override public init<T>(_ v: T)

    Parameters

    v

    value to initialise with

  • Creates an instance initialized to the given string value.

    Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example:

    let s: Value = "string"
    

    Declaration

    Swift

    public required convenience init(stringLiteral value: StringLiteralType)

    Parameters

    value

    The value of the new instance.

  • Creates an instance initialized to the given value.

    Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example:

    let s: Value = "string"
    

    Declaration

    Swift

    public required convenience init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType)

    Parameters

    value

    The value of the new instance.

  • Creates an instance initialized to the given value.

    Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example:

    let s: Value = "string"
    

    Declaration

    Swift

    public required convenience init(unicodeScalarLiteral value: UnicodeScalarLiteralType)

    Parameters

    value

    The value of the new instance.

  • Creates an instance initialized to the specified integer value.

    Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example:

    let x: Value = 23
    

    In this example, the assignment to the x constant calls this integer literal initializer behind the scenes.

    Declaration

    Swift

    public required convenience init(integerLiteral value: IntegerLiteralType)

    Parameters

    value

    The value to create.

  • Creates an instance initialized to the specified floating-point value.

    Do not call this initializer directly. Instead, initialize a variable or constant using a floating-point literal. For example:

    let x: Value = 21.5
    

    In this example, the assignment to the x constant calls this floating-point literal initializer behind the scenes.

    Declaration

    Swift

    public required convenience init(floatLiteral value: FloatLiteralType)

    Parameters

    value

    The value to create.

  • Creates an instance initialized to the given Boolean value.

    Do not call this initializer directly. Instead, initialize a variable or constant using one of the Boolean literals true and false. For example:

    let twasBrilling: Value = true
    

    In this example, the assignment to the twasBrillig constant calls this Boolean literal initializer behind the scenes.

    Declaration

    Swift

    public required convenience init(booleanLiteral value: BooleanLiteralType)

    Parameters

    value

    The value of the new instance.