Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Zeeshan Khan zeeshankhan

🏠
Working from home
View GitHub Profile
@zeeshankhan
zeeshankhan / Queue.swift
Last active Mar 15, 2016
Queue using value type generics and memory pointers
View Queue.swift
protocol QueueType {
typealias Element
mutating func enqueue(element: Element)
mutating func dequeue() -> Element?
func peek() -> Element?
}
final class Storage<Element> {
View IsUniquelyReference.swift
class A {
var x = "a"
}
var a: A = A()
isUniquelyReferencedNonObjC(&a)
var b = a
isUniquelyReferencedNonObjC(&a)