Avatar
norio_nomura 10/9/2018 2:09 PM
@swift-4.2.4 -frontend -repl struct RGBA<Channel> { var red: Channel var green: Channel var blue: Channel var alpha: Channel } MemoryLayout<RGBA<UInt8>>.stride // 4 MemoryLayout<RGBA<UInt8>>.offset(of: \RGBA<UInt8>.red) // 0 MemoryLayout<RGBA<UInt8>>.offset(of: \RGBA<UInt8>.green) // 1 MemoryLayout<RGBA<UInt8>>.offset(of: \RGBA<UInt8>.blue) // 2 MemoryLayout<RGBA<UInt8>>.offset(of: \RGBA<UInt8>.alpha) // 3 (edited)