RecordType
public struct RecordType: ClangTypeBacked
MARK: Special Types
-
Computes the offset of a named field in a record of the given type in bytes as it would be returned by offsetof as per C++11[18.2p4]
Throws
TypeLayoutError.invalid
if the type declaration is not a record field.TypeLayoutError.incomplete
if the type declaration is an incomplete typeTypeLayoutError.dependent
if the type declaration is dependentTypeLayoutError.invalidFieldName
if the field is not found in the receiving type.
Declaration
Swift
public func offsetOf(fieldName: String) throws -> Int
Return Value
The offset of a field with the given name in the type.
-
Gathers and returns all the fields of this record.
Declaration
Swift
public func fields() -> [Cursor]